From c946981296610251fd026512961729fa5d884951 Mon Sep 17 00:00:00 2001 From: Axel Doerfler Date: Mon, 15 Apr 2013 20:26:09 +0200 Subject: [PATCH] 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. --- .../network/notifications/notifications.cpp | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/add-ons/kernel/network/notifications/notifications.cpp b/src/add-ons/kernel/network/notifications/notifications.cpp index 7c2544cbc8..565d4cb233 100644 --- a/src/add-ons/kernel/network/notifications/notifications.cpp +++ b/src/add-ons/kernel/network/notifications/notifications.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2008, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2008-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -21,16 +21,18 @@ class NetNotificationService : public DefaultUserNotificationService { public: - NetNotificationService(); - virtual ~NetNotificationService(); + NetNotificationService(); + virtual ~NetNotificationService(); - void Notify(const KMessage& event); + void Notify(const KMessage& event); protected: - virtual void FirstAdded(); - virtual void LastRemoved(); + virtual void LastReferenceReleased(); + virtual void FirstAdded(); + virtual void LastRemoved(); }; + static NetNotificationService sNotificationService; @@ -38,8 +40,11 @@ static NetNotificationService sNotificationService; 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 NetNotificationService::FirstAdded() {