+2012-01-02 Sam Weinig <sam@webkit.org>
+
+ REGRESSION(r100517): We're leaking many, many DOM objects!
+ https://bugs.webkit.org/show_bug.cgi?id=75451
+
+ Reviewed by Mark Rowe.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ Add a temporary workaround to the problem of handle finalizers
+ not getting called by adding back the destructors (or rather
+ their replacement, destroy() functions).
+
2012-01-02 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Fix chromium mac build after r103905
push(@headerContent, " bool putDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSC::PutPropertySlot&);\n") if $dataNode->extendedAttributes->{"DelegatingPutFunction"};
}
+ if (!$hasParent) {
+ push(@headerContent, " static void destroy(JSC::JSCell*);\n");
+ }
+
# Class info
push(@headerContent, " static const JSC::ClassInfo s_info;\n\n");
if (!$hasParent) {
push(@headerContent, " $implType* impl() const { return m_impl; }\n");
push(@headerContent, " void releaseImpl() { m_impl->deref(); m_impl = 0; }\n\n");
+ push(@headerContent, " void releaseImplIfNotNull() { if (m_impl) { m_impl->deref(); m_impl = 0; } }\n\n");
push(@headerContent, "private:\n");
push(@headerContent, " $implType* m_impl;\n");
} elsif ($dataNode->extendedAttributes->{"GenerateNativeConverter"}) {
push(@implContent, "}\n\n");
}
+ if (!$hasParent) {
+ # FIXME: This destroy function should not be necessary, as
+ # a finalizer should be called for each DOM object wrapper.
+ # However, that seems not to be the case, so this has been
+ # added back to avoid leaking while we figure out why the
+ # finalizers are not always getting called. The work tracking
+ # the finalizer issue is being tracked in http://webkit.org/b/75451
+ push(@implContent, "void ${className}::destroy(JSC::JSCell* cell)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " ${className}* thisObject = jsCast<${className}*>(cell);\n");
+ push(@implContent, " releaseImplIfNotNull();\n");
+ push(@implContent, "}\n\n");
+ }
+
my $hasGetter = $numAttributes > 0
|| !$dataNode->extendedAttributes->{"OmitConstructor"}
|| $dataNode->extendedAttributes->{"HasIndexGetter"}