From 17c68d1710c3d3d6bd631bedf642ed22acd039e1 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 30 Jul 2011 13:33:38 +0200 Subject: [PATCH] callcatcher: bring HttpRequest dtor back This partially reverts 7cb18732923040b27ebd0d1f9c9bc01766d04d59 and fixes a potential leak. --- automation/source/testtool/httprequest.cxx | 9 +++++++++ automation/source/testtool/httprequest.hxx | 1 + automation/source/testtool/objtest.cxx | 1 + 3 files changed, 11 insertions(+) diff --git a/automation/source/testtool/httprequest.cxx b/automation/source/testtool/httprequest.cxx index 4910ba79ec7c..6442ad078fd9 100644 --- a/automation/source/testtool/httprequest.cxx +++ b/automation/source/testtool/httprequest.cxx @@ -50,6 +50,15 @@ HttpRequest::HttpRequest() { } +HttpRequest::~HttpRequest() +{ + delete pStream; + pStream = NULL; + + delete pOutSocket; + pOutSocket = NULL; +} + void HttpRequest::SetRequest( rtl::OString aHost, rtl::OString aPath, sal_uInt16 nPort ) { nStatus = HTTP_REQUEST_SET; diff --git a/automation/source/testtool/httprequest.hxx b/automation/source/testtool/httprequest.hxx index a8a901f1c38d..a8f333718db5 100644 --- a/automation/source/testtool/httprequest.hxx +++ b/automation/source/testtool/httprequest.hxx @@ -65,6 +65,7 @@ class HttpRequest void Init(); public: HttpRequest(); + ~HttpRequest(); void SetRequest( rtl::OString aHost, rtl::OString aPath, sal_uInt16 nPort ); void SetProxy( rtl::OString aHost, sal_uInt16 nPort ); diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 7247ff38b046..a4c86eaf96ab 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -740,6 +740,7 @@ TestToolObj::~TestToolObj() if ( pImpl->pTTSfxBroadcaster ) delete pImpl->pTTSfxBroadcaster; delete pImpl->pChildEnv; + delete pImpl->pHttpRequest; pImpl->xErrorList.Clear(); pImpl->xWarningList.Clear();