clientprefs now uses the new dbi dependency shim
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402316
This commit is contained in:
parent
968045ae62
commit
b01dd0798c
@ -87,6 +87,8 @@ bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbi->AddDependency(myself, Driver);
|
||||||
|
|
||||||
const char *identifier = Driver->GetIdentifier();
|
const char *identifier = Driver->GetIdentifier();
|
||||||
|
|
||||||
if (strcmp(identifier, "sqlite") == 0)
|
if (strcmp(identifier, "sqlite") == 0)
|
||||||
@ -202,6 +204,25 @@ void ClientPrefs::SDK_OnAllLoaded()
|
|||||||
playerhelpers->AddClientListener(&g_CookieManager);
|
playerhelpers->AddClientListener(&g_CookieManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ClientPrefs::QueryInterfaceDrop(SMInterface *pInterface)
|
||||||
|
{
|
||||||
|
if ((void *)pInterface == (void *)(Database->GetDriver()))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientPrefs::NotifyInterfaceDrop(SMInterface *pInterface)
|
||||||
|
{
|
||||||
|
if (Database != NULL && (void *)pInterface == (void *)(Database->GetDriver()))
|
||||||
|
{
|
||||||
|
Database->Close();
|
||||||
|
Database = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ClientPrefs::SDK_OnUnload()
|
void ClientPrefs::SDK_OnUnload()
|
||||||
{
|
{
|
||||||
handlesys->RemoveType(g_CookieType, myself->GetIdentity());
|
handlesys->RemoveType(g_CookieType, myself->GetIdentity());
|
||||||
@ -209,7 +230,10 @@ void ClientPrefs::SDK_OnUnload()
|
|||||||
|
|
||||||
g_CookieManager.Unload();
|
g_CookieManager.Unload();
|
||||||
|
|
||||||
Database->Close();
|
if (Database != NULL)
|
||||||
|
{
|
||||||
|
Database->Close();
|
||||||
|
}
|
||||||
|
|
||||||
forwards->ReleaseForward(g_CookieManager.cookieDataLoadedForward);
|
forwards->ReleaseForward(g_CookieManager.cookieDataLoadedForward);
|
||||||
|
|
||||||
|
@ -75,6 +75,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void SDK_OnAllLoaded();
|
virtual void SDK_OnAllLoaded();
|
||||||
|
|
||||||
|
virtual bool QueryInterfaceDrop(SMInterface *pInterface);
|
||||||
|
|
||||||
|
virtual void NotifyInterfaceDrop(SMInterface *pInterface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Called when the pause state is changed.
|
* @brief Called when the pause state is changed.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user