Reviewed by Maciej.
- make the close method do a more-complete job to prevent world leaks seen when
running some of the layout tests
* WebView/WebHTMLViewInternal.h: Added declaration of -[WebHTMLViewPrivate clear].
* WebView/WebHTMLView.m:
(-[WebHTMLViewPrivate clear]): Added method to drop references to other objects.
We want to do this at "close" time, rather than waiting for deallocation time.
This is especially important for the data source, which indirectly keeps a number of
objects alive.
(-[WebHTMLView close]): Added an explicit call to clear out the data source on the
plug-in controller. Without this, we'd see the plug-in controller making calls to
a deallocated data source during the layout tests. Added a call to the new clear method
on the private object so that we release the objects at close time instead of waiting
for deallocation time.
* WebKit.xcodeproj/project.pbxproj: Let Xcode have its way with the project file,
because I can't fight the power.
WebKitTools:
Reviewed by Maciej.
- a couple changes to reduce the chance of false positives on the leakbot
* DumpRenderTree/DumpRenderTree.m:
(dumpRenderTree): Move the main function into a separate function so we can run
a final garbage collect afterward without any stray values on the stack. Replaced
the old way of closing down a WebView (setting the delegates to nil) with the new
way (calling the close method), which does a more complete job of shutting
everything down without waiting for the WebView object to be deallocated.
(main): Put auto-release pool here and added an explicit call to garbage collect.
With a separate function, we greatly reduce the chance that a stray address on the
stack will keep an object alive.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Let Xcode do its thing,
because I don't have what it takes to fight the power.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17871
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-11-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - make the close method do a more-complete job to prevent world leaks seen when
+ running some of the layout tests
+
+ * WebView/WebHTMLViewInternal.h: Added declaration of -[WebHTMLViewPrivate clear].
+ * WebView/WebHTMLView.m:
+ (-[WebHTMLViewPrivate clear]): Added method to drop references to other objects.
+ We want to do this at "close" time, rather than waiting for deallocation time.
+ This is especially important for the data source, which indirectly keeps a number of
+ objects alive.
+ (-[WebHTMLView close]): Added an explicit call to clear out the data source on the
+ plug-in controller. Without this, we'd see the plug-in controller making calls to
+ a deallocated data source during the layout tests. Added a call to the new clear method
+ on the private object so that we release the objects at close time instead of waiting
+ for deallocation time.
+
+ * WebKit.xcodeproj/project.pbxproj: Let Xcode have its way with the project file,
+ because I can't fight the power.
+
2006-11-20 Samuel Weinig <sam@webkit.org>
Reviewed by Alexey.
mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
+ projectRoot = "";
targets = (
9398100A0824BF01008DF038 /* WebKit */,
);
[super dealloc];
}
+- (void)clear
+{
+ [mouseDownEvent release];
+ [keyDownEvent release];
+ [draggingImageURL release];
+ [pluginController release];
+ [toolTip release];
+ [compController release];
+ [firstResponderTextViewAtMouseDownTime release];
+ [dataSource release];
+ [highlighters release];
+
+ mouseDownEvent = nil;
+ keyDownEvent = nil;
+ draggingImageURL = nil;
+ pluginController = nil;
+ toolTip = nil;
+ compController = nil;
+ firstResponderTextViewAtMouseDownTime = nil;
+ dataSource = nil;
+ highlighters = nil;
+}
+
@end
@implementation WebHTMLView (WebHTMLViewFileInternal)
// FIXME: This is slow; should remove individual observers instead.
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_private->pluginController destroyAllPlugins];
+ [_private->pluginController setDataSource:nil];
// remove tooltips before clearing _private so removeTrackingRect: will work correctly
[self removeAllToolTips];
+ [_private clear];
_private->closed = YES;
}
WebDataSource *dataSource;
}
+- (void)clear;
@end
@interface WebHTMLView (WebInternal)
+2006-11-21 Darin Adler <darin@apple.com>
+
+ Reviewed by Maciej.
+
+ - a couple changes to reduce the chance of false positives on the leakbot
+
+ * DumpRenderTree/DumpRenderTree.m:
+ (dumpRenderTree): Move the main function into a separate function so we can run
+ a final garbage collect afterward without any stray values on the stack. Replaced
+ the old way of closing down a WebView (setting the delegates to nil) with the new
+ way (calling the close method), which does a more complete job of shutting
+ everything down without waiting for the WebView object to be deallocated.
+ (main): Put auto-release pool here and added an explicit call to garbage collect.
+ With a separate function, we greatly reduce the chance that a stray address on the
+ stack will keep an object alive.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Let Xcode do its thing,
+ because I don't have what it takes to fight the power.
+
2006-11-17 Zack Rusin <zack@kde.org>
Reviewed by Mitz. Landed by Niko.
zone->realloc = checkedRealloc;
}
-int main(int argc, const char *argv[])
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
+void dumpRenderTree(int argc, const char *argv[])
+{
[NSApplication sharedApplication];
class_poseAs(objc_getClass("DumpRenderTreePasteboard"), objc_getClass("NSPasteboard"));
[workQueue release];
- [webView setFrameLoadDelegate:nil];
- [webView setEditingDelegate:nil];
- [webView setUIDelegate:nil];
+ [webView close];
frame = nil;
// Work around problem where registering drag types leaves an outstanding
if (dumpPixels)
restoreColorSpace(0);
-
- [pool release];
+}
+int main(int argc, const char *argv[])
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ dumpRenderTree(argc, argv);
+ [WebCoreStatistics garbageCollectJavaScriptObjects];
+ [pool release];
return 0;
}
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */;
- compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* DumpRenderTree */;
productRefGroup = 9340995508540CAF007F3BC8 /* Products */;
projectDirPath = "";
projectRoot = "";
- shouldCheckCompatibility = 1;
targets = (
A84F608D08B1370600E9745F /* All */,
9340994A08540CAE007F3BC8 /* DumpRenderTree */,