* Set the global BMediaRoster instance pointer to NULL in the destructor,

the DefaultDeleter is not the only situation in which the instance might
  be deleted, a client app can also call Quit() on the BMediaRoster instance.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24556 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-03-24 15:16:55 +00:00
parent a121b8c83c
commit 8b940bb400
1 changed files with 12 additions and 3 deletions

View File

@ -28,10 +28,12 @@
*/
/* to comply with the license above, do not remove the following line */
char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002-2006 Marcus Overhagen <Marcus@Overhagen.de>";
char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002-2006 Marcus "
"Overhagen <Marcus@Overhagen.de>";
//#define DEBUG 7
#include <MediaRoster.h>
#include <Locker.h>
#include <Message.h>
#include <Messenger.h>
@ -42,6 +44,7 @@ char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002-2006 Marcus Ove
#include <ParameterWeb.h>
#include <BufferProducer.h>
#include <BufferConsumer.h>
#include "debug.h"
#include "MediaRosterEx.h"
#include "MediaMisc.h"
@ -112,11 +115,13 @@ BMediaRosterEx::SaveNodeConfiguration(BMediaNode *node)
}
status_t
BMediaRosterEx::LoadNodeConfiguration(media_addon_id addonid, int32 flavorid, BMessage *out_msg)
BMediaRosterEx::LoadNodeConfiguration(media_addon_id addonid, int32 flavorid,
BMessage *out_msg)
{
// XXX fix this
out_msg->MakeEmpty(); // to be fully R5 compliant
printf("### BMediaRosterEx::LoadNodeConfiguration should load addon-id %ld, flavor-id %ld config NOW!\n", addonid, flavorid);
printf("### BMediaRosterEx::LoadNodeConfiguration should load addon-id "
"%ld, flavor-id %ld config NOW!\n", addonid, flavorid);
return B_OK;
}
@ -2914,6 +2919,10 @@ BMediaRoster::~BMediaRoster()
server_unregister_app_reply reply;
request.team = team;
QueryServer(SERVER_UNREGISTER_APP, &request, sizeof(request), &reply, sizeof(reply));
// Unset the global instance pointer, the destructor is also called
// if a client app calls Lock(); and Quit(); directly.
_sDefault = NULL;
}