You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2012/07/01 16:39:17 UTC

[Bug 120095] openoffice crashes when the first time to exit quickstarter after it being enabled

https://issues.apache.org/ooo/show_bug.cgi?id=120095

--- Comment #8 from Ariel Constenla-Haile <ar...@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.