Prev Previous Post   Next Post Next
Old 7th November 2007, 22:37   #11
Maxim
Senior Member
 
Join Date: Mar 2001
Location: smspower.org
Posts: 107
Re: Backwards compatibility fix for Global Config

Quote:
Originally posted by Benski
code:
api_config *GetConfigAPI()
{
if (!serviceApi)
{
serviceApi = (api_service *)SendMessage(mod.hMainWindow, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
}

if (serviceApi && !configApi)
{
waServiceFactory *sf= (waServiceFactory *)serviceApi->service_getServiceByGuid(AgaveConfigGUID);
configApi = (api_config *)sf->getInterface();
}

return configApi;
}

Bugfix 2:
code:
api_config *GetConfigAPI()
{
if (!serviceApi)
{
serviceApi = (api_service *)SendMessage(mod.hMainWindow, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
}

if ((int)serviceApi == 1)
return NULL;

if (serviceApi && !configApi)
{
waServiceFactory *sf= (waServiceFactory *)serviceApi->service_getServiceByGuid(AgaveConfigGUID);
if (!sf)
return NULL;

configApi = (api_config *)sf->getInterface();
}

return configApi;
}


Older Winamps crash without the second check.
Maxim is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump