This should get the DEBUG=1 build further than the net.

* We need to start with a zero reference count, and we also don't want to
  be deleted by that mechanism.
* Note, I could not test the changes yet.
This commit is contained in:
Axel Doerfler
2013-04-15 20:26:09 +02:00
parent c61ed599d4
commit c946981296
@@ -1,5 +1,5 @@
/* /*
* Copyright 2008, Axel Dörfler, [email protected]. * Copyright 2008-2013, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -21,16 +21,18 @@
class NetNotificationService : public DefaultUserNotificationService { class NetNotificationService : public DefaultUserNotificationService {
public: public:
NetNotificationService(); NetNotificationService();
virtual ~NetNotificationService(); virtual ~NetNotificationService();
void Notify(const KMessage& event); void Notify(const KMessage& event);
protected: protected:
virtual void FirstAdded(); virtual void LastReferenceReleased();
virtual void LastRemoved(); virtual void FirstAdded();
virtual void LastRemoved();
}; };
static NetNotificationService sNotificationService; static NetNotificationService sNotificationService;
@@ -38,8 +40,11 @@ static NetNotificationService sNotificationService;
NetNotificationService::NetNotificationService() NetNotificationService::NetNotificationService()
: DefaultUserNotificationService("network") :
DefaultUserNotificationService("network")
{ {
// We need to set the reference count to zero for DEBUG builds
fReferenceCount = 0;
} }
@@ -61,6 +66,13 @@ NetNotificationService::Notify(const KMessage& event)
} }
void
NetNotificationService::LastReferenceReleased()
{
// don't delete us here
}
void void
NetNotificationService::FirstAdded() NetNotificationService::FirstAdded()
{ {