incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 120095] openoffice crashes when the first time to exit quickstarter after it being enabled
Date Sun, 01 Jul 2012 14:39:17 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=120095

--- Comment #8 from Ariel Constenla-Haile <arielch@apache.org> ---
Committed in trunk under revision 1355915

Applied the attached patch with a few modifications to prevent a leak when
posting the user event fails.
ToDo: I took the idea of the asynchronous desktop termination from the way how
UI elements' controllers call the dispatch (the scenario is almost the same as
in this crash report, just search "Application::PostUserEvent" in svtools and
framework), most code on these modules should fix the leak, see for example 
main/framework/source/uielement/recentfilesmenucontroller.cxx
framework::RecentFilesMenuController::executeEntry( sal_Int32 nIndex )

if ( xDispatch.is() )
{
    // Call dispatch asychronously as we can be destroyed while dispatch is
    // executed. VCL is not able to survive this as it wants to call listeners
    // after select!!!
    LoadRecentFile* pLoadRecentFile = new LoadRecentFile;
    pLoadRecentFile->xDispatch  = xDispatch;
    pLoadRecentFile->aTargetURL = aTargetURL;
    pLoadRecentFile->aArgSeq    = aArgsList;

    if(::comphelper::UiEventsLogger::isEnabled()) //#i88653#
       
UiEventLogHelper(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RecentFilesMenuController"))).log(m_xServiceManager,
m_xFrame, aTargetURL, aArgsList);

    Application::PostUserEvent( STATIC_LINK(0, RecentFilesMenuController,
ExecuteHdl_Impl), pLoadRecentFile );
}

to fix the leak:

if (!Application::PostUserEvent( STATIC_LINK(0, RecentFilesMenuController,
ExecuteHdl_Impl), pLoadRecentFile ))
delete  pLoadRecentFile;

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message