diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-06-11 15:04:48 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-06-11 15:04:48 +0200 |
| commit | 7104746413c6327d82340dede4abd06bb65f9032 (patch) | |
| tree | 3318072a70446f69a7f34d02ac4ac7a4170478ae | |
| parent | d7d1d0d6b2be85d562d6c0a0d910e2af260f8a6b (diff) | |
Fix crash in howto-drag-and-drop under macOS
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index 00fc63150..5091f894b 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -31,7 +31,8 @@ Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int if (high_res) { s = Fl_Graphics_Driver::default_driver().scale(); Fl_Window *cw = Fl_Window::current(); - if (cw && Fl_Cocoa_Window_Driver::driver(cw)->mapped_to_retina()) s *= 2; + Fl_Cocoa_Window_Driver *dr = cw ? Fl_Cocoa_Window_Driver::driver(cw) : NULL; + if (dr && dr->mapped_to_retina()) s *= 2; W *= s; H *= s; } CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB(); |
