Skip to content

Commit

Permalink
Bug 1168843 - use thread-safe refcounting for shared memory surfaces …
Browse files Browse the repository at this point in the history
…to avoid shutdown crashes. r=jmuizelaar
  • Loading branch information
lsalzman committed May 27, 2015
1 parent 9a1b3f2 commit 7b8fa17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ipc/glue/SharedMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class SharedMemory
SystemProtect(aAddr, aSize, aRights);
}

NS_INLINE_DECL_REFCOUNTING(SharedMemory)
// bug 1168843, compositor thread may create shared memory instances that are destroyed by main thread on shutdown, so this must use thread-safe RC to avoid hitting assertion
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedMemory)

static void SystemProtect(char* aAddr, size_t aSize, int aRights);
static size_t SystemPageSize();
Expand Down
3 changes: 2 additions & 1 deletion widget/nsShmImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class QWindow;
class gfxASurface;

class nsShmImage {
NS_INLINE_DECL_REFCOUNTING(nsShmImage)
// bug 1168843, compositor thread may create shared memory instances that are destroyed by main thread on shutdown, so this must use thread-safe RC to avoid hitting assertion
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsShmImage)

typedef mozilla::ipc::SharedMemorySysV SharedMemorySysV;

Expand Down

0 comments on commit 7b8fa17

Please sign in to comment.