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:
David Anderson 2008-07-01 06:13:09 +00:00
parent 968045ae62
commit b01dd0798c
2 changed files with 29 additions and 1 deletions
extensions/clientprefs

View File

@ -87,6 +87,8 @@ bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
return false;
}
dbi->AddDependency(myself, Driver);
const char *identifier = Driver->GetIdentifier();
if (strcmp(identifier, "sqlite") == 0)
@ -202,6 +204,25 @@ void ClientPrefs::SDK_OnAllLoaded()
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()
{
handlesys->RemoveType(g_CookieType, myself->GetIdentity());
@ -209,7 +230,10 @@ void ClientPrefs::SDK_OnUnload()
g_CookieManager.Unload();
Database->Close();
if (Database != NULL)
{
Database->Close();
}
forwards->ReleaseForward(g_CookieManager.cookieDataLoadedForward);

View File

@ -75,6 +75,10 @@ public:
*/
virtual void SDK_OnAllLoaded();
virtual bool QueryInterfaceDrop(SMInterface *pInterface);
virtual void NotifyInterfaceDrop(SMInterface *pInterface);
/**
* @brief Called when the pause state is changed.
*/