Disconnect from region change callback if AOEngine gets destroyed
parent
4200044961
commit
470a273529
|
|
@ -66,12 +66,17 @@ AOEngine::AOEngine() :
|
|||
{
|
||||
gSavedPerAccountSettings.getControl("UseAO")->getCommitSignal()->connect(boost::bind(&AOEngine::onToggleAOControl, this));
|
||||
|
||||
gAgent.addRegionChangedCallback(boost::bind(&AOEngine::onRegionChange, this));
|
||||
mRegionChangeConnection = gAgent.addRegionChangedCallback(boost::bind(&AOEngine::onRegionChange, this));
|
||||
}
|
||||
|
||||
AOEngine::~AOEngine()
|
||||
{
|
||||
clear(false);
|
||||
|
||||
if (mRegionChangeConnection.connected())
|
||||
{
|
||||
mRegionChangeConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void AOEngine::init()
|
||||
|
|
|
|||
|
|
@ -214,6 +214,8 @@ class AOEngine
|
|||
std::vector<AOSet*> mOldImportSets;
|
||||
LLUUID mImportCategory;
|
||||
S32 mImportRetryCount;
|
||||
|
||||
boost::signals2::connection mRegionChangeConnection;
|
||||
};
|
||||
|
||||
#endif // AOENGINE_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue