b=1043772 assert ScopedXErrorHandler is used only on main thread r=nical

--HG--
extra : rebase_source : 737a78cabe0cb9a44786cd562cc1e34bafd7a2a0
This commit is contained in:
Karl Tomlinson 2014-07-24 17:51:26 +12:00
parent 3b2ebbc002
commit 220325656a

View File

@ -7,6 +7,7 @@
#include "X11Util.h"
#include "nsDebug.h" // for NS_ASSERTION, etc
#include "MainThreadUtils.h" // for NS_IsMainThread
namespace mozilla {
@ -58,6 +59,7 @@ ScopedXErrorHandler::ErrorHandler(Display *, XErrorEvent *ev)
ScopedXErrorHandler::ScopedXErrorHandler()
{
MOZ_ASSERT(NS_IsMainThread());
// let sXErrorPtr point to this object's mXError object, but don't reset this mXError object!
// think of the case of nested ScopedXErrorHandler's.
mOldXErrorPtr = sXErrorPtr;