Browse Source

Fixed a few singletons which had forgotten to call clearSingletonInstance() in their destructors

tags/2021-05-28
jules 7 years ago
parent
commit
bc90a41386
4 changed files with 14 additions and 2 deletions
  1. +4
    -2
      modules/juce_events/native/juce_android_Messaging.cpp
  2. +2
    -0
      modules/juce_events/native/juce_win32_WinRTWrapper.h
  3. +3
    -0
      modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp
  4. +5
    -0
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 4
- 2
modules/juce_events/native/juce_android_Messaging.cpp View File

@@ -58,9 +58,10 @@ namespace Android
struct Handler
{
JUCE_DECLARE_SINGLETON (Handler, false)
Handler() : nativeHandler (getEnv()->NewObject (JNIHandler, JNIHandler.constructor)) {}
~Handler() { clearSingletonInstance(); }
JUCE_DECLARE_SINGLETON (Handler, false)
bool post (jobject runnable)
{
@@ -86,6 +87,7 @@ struct AndroidMessageQueue : private Android::Runnable
~AndroidMessageQueue()
{
jassert (MessageManager::getInstance()->isThisTheMessageThread());
clearSingletonInstance();
}
bool post (MessageManager::MessageBase::Ptr&& message)


+ 2
- 0
modules/juce_events/native/juce_win32_WinRTWrapper.h View File

@@ -60,6 +60,8 @@ public:
{
if (winRTHandle != nullptr)
::FreeLibrary (winRTHandle);
clearSingletonInstance();
}
String hStringToString (HSTRING hstr)


+ 3
- 0
modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp View File

@@ -73,6 +73,9 @@ struct ReportingThread;
struct ReportingThreadContainer : public ChangeListener,
public DeletedAtShutdown
{
ReportingThreadContainer() {}
~ReportingThreadContainer() { clearSingletonInstance(); }
void sendReport (String, String&, StringPairArray&);
void changeListenerCallback (ChangeBroadcaster*) override;


+ 5
- 0
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -763,6 +763,11 @@ private:
tipInvocation.CoCreateInstance (ITipInvocation::getCLSID(), CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER);
}
~OnScreenKeyboard()
{
clearSingletonInstance();
}
void timerCallback() override
{
stopTimer();


Loading…
Cancel
Save