webengine/osswebengine/WebCore/platform/network/symbian/ResourceLoaderDelegate.cpp
--- a/webengine/osswebengine/WebCore/platform/network/symbian/ResourceLoaderDelegate.cpp Fri May 08 08:25:06 2009 +0300
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/ResourceLoaderDelegate.cpp Fri Jul 03 15:54:40 2009 +0100
@@ -95,6 +95,11 @@
connection->download(handle, request, response);
}
+static void cleanupConnection( TAny* connection )
+{
+ delete (ResolvedConnection*) connection;
+}
+
MUrlConnection* ResourceLoaderDelegate::checkLinkResolverL(ResourceHandle* handle, Frame* frame)
{
CBrCtl* brctl = control(frame);
@@ -117,9 +122,10 @@
}
}
connection = new (ELeave) ResolvedConnection(handle, frame);
- CleanupStack::PushL(connection);
+ TCleanupItem cleaner( cleanupConnection, connection );
+ CleanupStack::PushL(cleaner);
TBool ret = brctl->brCtlLinkResolver()->ResolveLinkL(url->Des(), currentUrlPtr, *connection);
- CleanupStack::Pop(); // connection
+ CleanupStack::Pop(); // cleaner( connection )
if (!ret) {
delete connection;
connection = NULL;
@@ -141,10 +147,11 @@
}
}
connection = new (ELeave) ResolvedConnection(handle, frame);
- CleanupStack::PushL(connection);
+ TCleanupItem cleaner( cleanupConnection, connection );
+ CleanupStack::PushL(cleaner);
TBool ret = brctl->brCtlLinkResolver()->ResolveEmbeddedLinkL(url->Des(), currentUrlPtr,
ELoadContentTypeAny, *connection);
- CleanupStack::Pop(); // connection
+ CleanupStack::Pop(); // cleaner( connection )
if (!ret) {
delete connection;
connection = NULL;