Fix for eventqueue objects leaking bug #20166. This also removes the hacked fix for bug #36361 and uses a real fix. Major overhaul of nsEventQueue and nsEventQueueService. r=waterson,brendan. tested on windows, linux and mac
git-svn-id: svn://10.0.0.236/trunk@71554 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -27,25 +27,11 @@
|
||||
#include "nsHashtable.h"
|
||||
|
||||
class nsIEventQueue;
|
||||
class EventQueueEntry;
|
||||
|
||||
// because available enumerators can't handle deletions during enumeration
|
||||
class EventQueueEntryEnumerator {
|
||||
public:
|
||||
EventQueueEntryEnumerator();
|
||||
virtual ~EventQueueEntryEnumerator();
|
||||
void Reset(EventQueueEntry *aStart);
|
||||
EventQueueEntry *Get(void);
|
||||
void Skip(EventQueueEntry *aSkip);
|
||||
private:
|
||||
EventQueueEntry *mCurrent;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class nsEventQueueServiceImpl : public nsIEventQueueService
|
||||
{
|
||||
friend class EventQueueEntry;
|
||||
public:
|
||||
nsEventQueueServiceImpl();
|
||||
virtual ~nsEventQueueServiceImpl();
|
||||
@@ -76,13 +62,11 @@ private:
|
||||
Addref the descriptor in any case. parameter aNative is
|
||||
ignored if the queue already exists. */
|
||||
NS_IMETHOD CreateEventQueue(PRThread *aThread, PRBool aNative);
|
||||
void AddEventQueueEntry(EventQueueEntry *aEntry);
|
||||
void RemoveEventQueueEntry(EventQueueEntry *aEntry);
|
||||
NS_IMETHOD MakeNewQueue(PRThread* thread, PRBool aNative, nsIEventQueue **aQueue);
|
||||
inline nsresult GetYoungestEventQueue(nsIEventQueue *queue, nsIEventQueue **aResult);
|
||||
|
||||
nsHashtable *mEventQTable;
|
||||
EventQueueEntry *mBaseEntry;
|
||||
PRMonitor *mEventQMonitor;
|
||||
EventQueueEntryEnumerator mEnumerator;
|
||||
nsSupportsHashtable mEventQTable;
|
||||
PRMonitor *mEventQMonitor;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user