From 33bd5eca534e8d8935ebe721d22d671aede89e2f Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Tue, 18 Jul 2006 21:26:36 +0000 Subject: [PATCH] Remove the new wrapper from the map when postcreate fails so that we don't find it the next time we try to wrap that object. bug 344873, r=jst sr=brendan git-svn-id: svn://10.0.0.236/trunk@203033 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/src/xpconnect/src/xpcwrappednative.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp index dc0d15daef8..93c28467ad7 100644 --- a/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp @@ -461,7 +461,15 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx, rv = si->GetCallback()-> PostCreate(wrapper, ccx, wrapper->GetFlatJSObject()); if(NS_FAILED(rv)) + { + { // scoped lock + XPCAutoLock lock(mapLock); + map->Remove(wrapper); + } + + wrapper->Release(); return rv; + } } }