Fix reference count problem as suggested by Ingo.

During DefaultNotificationService's constructor, we get registered
with the NotificationManager, which acquires a reference. When
uninitializing the module we need to release this reference before
calling the destructor in order to balance the books, as it were.
This commit is contained in:
Rene Gollent
2013-04-15 20:54:31 -04:00
parent 001d65dba7
commit 00d0a0eae3
@@ -43,8 +43,6 @@ NetNotificationService::NetNotificationService()
:
DefaultUserNotificationService("network")
{
// We need to set the reference count to zero for DEBUG builds
fReferenceCount = 0;
}
@@ -145,6 +143,9 @@ notifications_std_ops(int32 op, ...)
unregister_generic_syscall(NET_NOTIFICATIONS_SYSCALLS, 1);
// we need to release the reference that was acquired
// on our behalf by the NotificationManager.
sNotificationService.ReleaseReference();
sNotificationService.~NetNotificationService();
return B_OK;