Properly release Growl during viewer shutdown

Ansariel 2015-03-07 00:44:25 +01:00
parent 5b648e4ebc
commit 17ef6bf3cd
6 changed files with 33 additions and 6 deletions

View File

@ -402,11 +402,20 @@ bool GrowlManager::shouldNotify()
return (activated || (!gViewerWindow->getWindow()->getVisible() || !gFocusMgr.getAppHasFocus()));
}
void GrowlManager::InitiateManager()
void GrowlManager::initiateManager()
{
gGrowlManager = new GrowlManager();
}
void GrowlManager::destroyManager()
{
if (gGrowlManager)
{
delete gGrowlManager;
gGrowlManager = NULL;
}
}
bool GrowlManager::isUsable()
{
return (gGrowlManager && gGrowlManager->mNotifier && gGrowlManager->mNotifier->isUsable());

View File

@ -62,7 +62,8 @@ public:
void notify(const std::string& notification_title, const std::string& notification_message, const std::string& notification_type);
BOOL tick();
static void InitiateManager();
static void initiateManager();
static void destroyManager();
static bool isUsable();
private:

View File

@ -40,8 +40,17 @@ GrowlNotifierWin::GrowlNotifierWin() :
mApplicationName(""),
mGrowlImpl(NULL)
{
LL_INFOS("GrowlNotifierWin") << "Windows growl notifications initialised." << LL_ENDL;
LL_INFOS("GrowlNotifierWin") << "Windows growl notifier initialized." << LL_ENDL;
}
GrowlNotifierWin::~GrowlNotifierWin()
{
LL_INFOS("GrowlNotifierWin") << "Windows growl notifier destroyed." << LL_ENDL;
if (mGrowlImpl)
{
delete mGrowlImpl;
mGrowlImpl = NULL;
}
}
void GrowlNotifierWin::registerApplication(const std::string& application, const std::set<std::string>& notificationTypes)

View File

@ -42,7 +42,8 @@ class GrowlNotifierWin : public GrowlNotifier
{
public:
GrowlNotifierWin();
virtual ~GrowlNotifierWin();
void showNotification(const std::string& notification_title, const std::string& notification_message, const std::string& notification_type);
bool isUsable();
void registerApplication(const std::string& application, const std::set<std::string>& notificationTypes);

View File

@ -247,6 +247,9 @@
#include "llviewereventrecorder.h"
#include "llleapmotioncontroller.h"
#if HAS_GROWL
#include "growlmanager.h"
#endif
// *FIX: These extern globals should be cleaned up.
@ -1972,6 +1975,10 @@ bool LLAppViewer::cleanup()
// workaround for DEV-35406 crash on shutdown
LLEventPumps::instance().reset();
#if HAS_GROWL
GrowlManager::destroyManager();
#endif
//dump scene loading monitor results
LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));

View File

@ -592,7 +592,7 @@ bool idle_startup()
// [/RLVa:KB]
#if HAS_GROWL
GrowlManager::InitiateManager();
GrowlManager::initiateManager();
#endif
// <FS:Ansariel> Store current font and skin for system info (FIRE-6806)