diff options
| author | Manolo Gouy <Manolo> | 2016-02-24 08:07:30 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-24 08:07:30 +0000 |
| commit | 6097c134d893c67aa6d3d56ee176531c481261a8 (patch) | |
| tree | 0f852ee2b98526ea3dbf039bd672f0646ca19f3a | |
| parent | 941c301cebc5e636667cca1ae8f3938a25d770df (diff) | |
Avoid static initializers to allow FLTK usage in static initializers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11213 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl.H | 2 | ||||
| -rw-r--r-- | src/Fl.cxx | 6 |
2 files changed, 2 insertions, 6 deletions
@@ -46,6 +46,7 @@ class Fl_Widget; class Fl_Window; class Fl_Image; struct Fl_Label; +class Fl_Screen_Driver; // Keep avoiding having the socket deps at that level but mke sure it will work in both 32 & 64 bit builds #if defined(WIN32) && !defined(__CYGWIN__) @@ -137,7 +138,6 @@ class FL_EXPORT Fl { private: - static class Fl_Screen_Driver *screen_driver_; static int use_high_res_GL_; public: diff --git a/src/Fl.cxx b/src/Fl.cxx index c0120b13d..a27a187fd 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -216,16 +216,12 @@ char const * const Fl::clipboard_image = "image"; // Drivers // -Fl_Screen_Driver *Fl::screen_driver_ = Fl_Screen_Driver::newScreenDriver(); - Fl_Screen_Driver *Fl::screen_driver() { - if (!screen_driver_) - screen_driver_ = Fl_Screen_Driver::newScreenDriver(); + static Fl_Screen_Driver* screen_driver_ = Fl_Screen_Driver::newScreenDriver(); return screen_driver_; } - // // 'Fl::version()' - Return the API version number... // |
