Bug 848386 part 1. Don't preserve our wrapper until we have one so unforgeable property setup won't try to preserve it. r=peterv

This commit is contained in:
Boris Zbarsky 2013-03-20 12:22:26 -04:00
Родитель 55ab35ff80
Коммит a804a3767b
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -865,8 +865,11 @@ class CGAddPropertyHook(CGAbstractClassHook):
preserveArgs = "reinterpret_cast<nsISupports*>(self), self"
else:
preserveArgs = "self, self, NS_CYCLE_COLLECTION_PARTICIPANT(%s)" % self.descriptor.nativeType
return """ nsContentUtils::PreserveWrapper(%s);
return true;""" % preserveArgs
return (" // We don't want to preserve if we don't have a wrapper.\n"
" if (self->GetWrapperPreserveColor()) {\n"
" nsContentUtils::PreserveWrapper(%s);\n"
" }\n"
" return true;" % preserveArgs)
def DeferredFinalizeSmartPtr(descriptor):
if descriptor.nativeOwnership == 'owned':