Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7003C356 for ; Mon, 25 Jun 2012 11:18:50 +0000 (UTC) Received: (qmail 683 invoked by uid 500); 25 Jun 2012 11:18:50 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 567 invoked by uid 500); 25 Jun 2012 11:18:50 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 539 invoked by uid 99); 25 Jun 2012 11:18:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2012 11:18:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jun 2012 11:18:48 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B29902388A32; Mon, 25 Jun 2012 11:18:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1353465 - in /incubator/ooo/trunk/main/framework: inc/services/frame.hxx source/services/frame.cxx Date: Mon, 25 Jun 2012 11:18:27 -0000 To: ooo-commits@incubator.apache.org From: hdu@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120625111827.B29902388A32@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hdu Date: Mon Jun 25 11:18:26 2012 New Revision: 1353465 URL: http://svn.apache.org/viewvc?rev=1353465&view=rev Log: #i120079# fix a memory leak in framework::Frame::initialize() Patch by: Chao Huang Found by: Chao Huang Review by: hdu Modified: incubator/ooo/trunk/main/framework/inc/services/frame.hxx incubator/ooo/trunk/main/framework/source/services/frame.cxx Modified: incubator/ooo/trunk/main/framework/inc/services/frame.hxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/framework/inc/services/frame.hxx?rev=1353465&r1=1353464&r2=1353465&view=diff ============================================================================== --- incubator/ooo/trunk/main/framework/inc/services/frame.hxx (original) +++ incubator/ooo/trunk/main/framework/inc/services/frame.hxx Mon Jun 25 11:18:26 2012 @@ -434,6 +434,7 @@ class Frame : // interfaces css::uno::Reference< ::com::sun::star::frame::XLayoutManager > m_xLayoutManager ; /// is used to layout the child windows of the frame. css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper ; css::uno::Reference< css::frame::XTitle > m_xTitleHelper ; + void* mp_WindowCommandDispatch ; /// holds the window command dispatch protected: Modified: incubator/ooo/trunk/main/framework/source/services/frame.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/framework/source/services/frame.cxx?rev=1353465&r1=1353464&r2=1353465&view=diff ============================================================================== --- incubator/ooo/trunk/main/framework/source/services/frame.cxx (original) +++ incubator/ooo/trunk/main/framework/source/services/frame.cxx Mon Jun 25 11:18:26 2012 @@ -294,6 +294,7 @@ Frame::Frame( const css::uno::Reference< , m_bSelfClose ( sal_False ) // Important! , m_bIsHidden ( sal_True ) , m_xTitleHelper ( ) + , mp_WindowCommandDispatch ( NULL ) , m_aChildFrameContainer ( ) { // Check incoming parameter to avoid against wrong initialization. @@ -316,6 +317,10 @@ Frame::Frame( const css::uno::Reference< Frame::~Frame() { LOG_ASSERT2( m_aTransactionManager.getWorkingMode()!=E_CLOSE, "Frame::~Frame()", "Who forgot to dispose this service?" ) + if (mp_WindowCommandDispatch != NULL) + { + delete ((WindowCommandDispatch *)mp_WindowCommandDispatch); // memory leak #i120079# + } } /*-************************************************************************************************************//** @@ -625,7 +630,7 @@ void SAL_CALL Frame::initialize( const c impl_enablePropertySet(); // create WindowCommandDispatch; it is supposed to release itself at frame destruction - (void)new WindowCommandDispatch(xSMGR, this); + mp_WindowCommandDispatch = new WindowCommandDispatch(xSMGR, this); // memory leak #i120079# // Initialize title functionality TitleHelper* pTitleHelper = new TitleHelper(xSMGR);