Bug 180169 ASSERTION: RgnRectMemoryAllocator not thread-safe triggers because static class exists past nspr shutdown

r=roc+moz sr=roc+moz
This commit is contained in:
timeless%mozdev.org 2003-05-23 21:42:36 +00:00
parent af2d8d7225
commit 4a9cdfd6ec

View File

@ -106,7 +106,21 @@ RgnRectMemoryAllocator::~RgnRectMemoryAllocator ()
FreeChunk (tmp);
}
#if 0
/*
* As a static object this class outlives any library which would implement
* locking. So we intentionally leak the 'lock'.
*
* Currently RgnRectMemoryAllocator is only used from the primary thread,
* so we aren't using a lock which means that there is no lock to leak.
* If we ever switch to multiple GUI threads (e.g. one per window),
* we'd probably use one allocator per window-thread to avoid the
* locking overhead and just require consumers not to pass regions
* across threads/windows, which would be a reasonable restriction
* because they wouldn't be useful outside their window.
*/
DestroyLock();
#endif
}
nsRegion::RgnRect* RgnRectMemoryAllocator::Alloc ()