uicore::SingletonBugfix Class Reference

Workaround for broken destruction of static member variables in MSVC. More...

#include <singleton_bugfix.h>

Static Public Member Functions

static void add_destructor (std::function< void()> destructor)
 
static void deinitialize ()
 

Detailed Description

Workaround for broken destruction of static member variables in MSVC.

The C++ runtime in Visual Studio 2013 and 2015 deinitializes the threading library prematurely. This causes std::thread and other standard library classes to not work in static member variables.

This SingletonBugfix and the Singleton template allows an application to deinitialize all static member variables wrapped by the Singleton template by calling SingletonBugfix::deinitialize()

Member Function Documentation

static void uicore::SingletonBugfix::add_destructor ( std::function< void()>  destructor)
static
static void uicore::SingletonBugfix::deinitialize ( )
static

The documentation for this class was generated from the following file: