mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
check for existence before NS_ADDREFing.
this was causing a crash in smtpTest, pop3Test and nntpTest, where we weren't registering the EventQueue component. also, make these destructors virtual.
This commit is contained in:
parent
6ffba108cb
commit
b2cb4ec80d
@ -97,7 +97,9 @@ EventQueueStack::~EventQueueStack()
|
||||
|
||||
nsIEventQueue* EventQueueStack::GetEventQueue()
|
||||
{
|
||||
NS_ADDREF(mEventQueue);
|
||||
if (mEventQueue) {
|
||||
NS_ADDREF(mEventQueue);
|
||||
}
|
||||
return mEventQueue;
|
||||
}
|
||||
|
||||
@ -122,7 +124,7 @@ class EventQueueEntry : public nsISupports
|
||||
{
|
||||
public:
|
||||
EventQueueEntry();
|
||||
~EventQueueEntry();
|
||||
virtual ~EventQueueEntry();
|
||||
|
||||
// nsISupports interface...
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -184,6 +186,7 @@ class nsEventQueueServiceImpl : public nsIEventQueueService
|
||||
{
|
||||
public:
|
||||
nsEventQueueServiceImpl();
|
||||
virtual ~nsEventQueueServiceImpl();
|
||||
|
||||
// nsISupports interface...
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -201,8 +204,6 @@ public:
|
||||
#ifdef XP_MAC
|
||||
NS_IMETHOD ProcessEvents();
|
||||
#endif // XP_MAC
|
||||
protected:
|
||||
~nsEventQueueServiceImpl();
|
||||
|
||||
private:
|
||||
nsHashtable* mEventQTable;
|
||||
|
@ -97,7 +97,9 @@ EventQueueStack::~EventQueueStack()
|
||||
|
||||
nsIEventQueue* EventQueueStack::GetEventQueue()
|
||||
{
|
||||
NS_ADDREF(mEventQueue);
|
||||
if (mEventQueue) {
|
||||
NS_ADDREF(mEventQueue);
|
||||
}
|
||||
return mEventQueue;
|
||||
}
|
||||
|
||||
@ -122,7 +124,7 @@ class EventQueueEntry : public nsISupports
|
||||
{
|
||||
public:
|
||||
EventQueueEntry();
|
||||
~EventQueueEntry();
|
||||
virtual ~EventQueueEntry();
|
||||
|
||||
// nsISupports interface...
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -184,6 +186,7 @@ class nsEventQueueServiceImpl : public nsIEventQueueService
|
||||
{
|
||||
public:
|
||||
nsEventQueueServiceImpl();
|
||||
virtual ~nsEventQueueServiceImpl();
|
||||
|
||||
// nsISupports interface...
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -201,8 +204,6 @@ public:
|
||||
#ifdef XP_MAC
|
||||
NS_IMETHOD ProcessEvents();
|
||||
#endif // XP_MAC
|
||||
protected:
|
||||
~nsEventQueueServiceImpl();
|
||||
|
||||
private:
|
||||
nsHashtable* mEventQTable;
|
||||
|
Loading…
Reference in New Issue
Block a user