Template startup issue: was:
	 $ soffice.bin slot:5500 

Now has screwed up lifecycle.

the desktop/source/app/dispatchwatcher.cxx does:

	// No more asynchronous requests?
	// The requests are removed from the request container after they called back to this
	// implementation via statusChanged!!
    if ( !m_nRequestCount /*m_aRequestContainer.empty()*/ )
	{
		// We have to check if we have an open task otherwise we have to shutdown the office.
        Reference< XFramesSupplier > xTasksSupplier( xDesktop, UNO_QUERY );
        aGuard.clear();

		fprintf( stderr, "dispatchwatcher: check for open tasks\n" );

        Reference< XElementAccess > xList( xTasksSupplier->getFrames(), UNO_QUERY );

        if ( !xList->hasElements() )
		{
			fprintf( stderr, "dispatchwatcher: apparently no open tasks => terminate [!]\n" );

			// We don't have any task open so we have to shutdown ourself!!
			Reference< XDesktop > xDesktop( xTasksSupplier, UNO_QUERY );
			if ( xDesktop.is() )
				xDesktop->terminate();
		}
	}

And quits before the toplevel has properly registered.

The templates & documents code is in:
    svtools/source/contrn/templwin*

Running the dialog trace is:

#0  0xffffe410 in ?? ()
#1  0xbfffd9b8 in ?? ()
#2  0x000000f9 in ?? ()
#3  0x00000007 in ?? ()
#4  0x42305558 in g_main_context_iterate () from /opt/gnome/lib/libglib-2.0.so.0
#5  0x423056c3 in g_main_context_iteration () from /opt/gnome/lib/libglib-2.0.so.0
#6  0x41e78832 in GtkXLib::Yield () from ./libvclplug_gtk680li.so
#7  0x423d505f in X11SalInstance::Yield () from ./libvclplug_gen680li.so
#8  0x40165732 in Application::Yield () from ./libvcl680li.so
#9  0x402c2640 in Dialog::Execute () from ./libvcl680li.so
#10 0x43ec7c50 in SfxApplication::NewDocExec_Impl () from ./libsfx680li.so
#11 0x43ecf97a in SfxStubSfxApplicationNewDocExec_Impl () from ./libsfx680li.so
#12 0x440371e3 in SfxDispatcher::Call_Impl () from ./libsfx680li.so
#13 0x44038364 in SfxDispatcher::_Execute () from ./libsfx680li.so
#14 0x44039389 in SfxDispatcher::Execute () from ./libsfx680li.so
#15 0x440307cd in SfxDispatchController_Impl::dispatch () from ./libsfx680li.so
#16 0x4402e8cd in SfxOfficeDispatch::dispatchWithNotification () from ./libsfx680li.so
#17 0x0809d425 in desktop::DispatchWatcher::executeDispatchRequests (this=0x8462ff0, aDispatchRequestsList=@0xbfffe350)
    at /opt/OpenOffice/src680-m79/desktop/source/app/dispatchwatcher.cxx:473
#18 0x08093606 in desktop::OfficeIPCThread::ExecuteCmdLineRequests (aRequest=@0xbfffe3c0)
    at /opt/OpenOffice/src680-m79/desktop/source/app/officeipcthread.cxx:818
#19 0x080858b8 in desktop::Desktop::OpenClients () at /opt/OpenOffice/src680-m79/desktop/source/app/app.cxx:2090
#20 0x08084c9b in desktop::Desktop::OpenClients_Impl (this=0xbfffed20, pvoid=0x0)
    at /opt/OpenOffice/src680-m79/desktop/source/app/app.cxx:1889
#21 0x08084c8e in desktop::Desktop::LinkStubOpenClients_Impl (pThis=0xbfffed20, pCaller=0x0)
    at /opt/OpenOffice/src680-m79/desktop/source/app/app.cxx:1885
#22 0x4033688f in ImplHandleUserEvent () from ./libvcl680li.so
#23 0x403373bf in ImplWindowFrameProc () from ./libvcl680li.so
#24 0x423d0b5b in SalDisplay::DispatchInternalEvent () from ./libvclplug_gen680li.so
#25 0x41e786a2 in GtkXLib::userEventFn () from ./libvclplug_gtk680li.so
#26 0x42301221 in g_idle_dispatch () from /opt/gnome/lib/libglib-2.0.so.0
#27 0x42302e87 in g_main_context_dispatch () from /opt/gnome/lib/libglib-2.0.so.0
#28 0x423055c7 in g_main_context_iterate () from /opt/gnome/lib/libglib-2.0.so.0
#29 0x423056c3 in g_main_context_iteration () from /opt/gnome/lib/libglib-2.0.so.0
#30 0x41e78832 in GtkXLib::Yield () from ./libvclplug_gtk680li.so
#31 0x423d505f in X11SalInstance::Yield () from ./libvclplug_gen680li.so
#32 0x40165732 in Application::Yield () from ./libvcl680li.so
#33 0x40165649 in Application::Execute () from ./libvcl680li.so
#34 0x08083d14 in desktop::Desktop::Main (this=0xbfffed20) at /opt/OpenOffice/src680-m79/desktop/source/app/app.cxx:1674
#35 0x4016b3c0 in SVMain () from ./libvcl680li.so
#36 0x0807c80d in sal_main ()
#37 0x0807c7bc in main ()


framework/source/services/desktop.cxx (getFrames)
    wrapper for 'OFrames *pFramesHelper'
    only accessed via getFrames, wraps: -> m_aChildTaskContainer
	getFrames-> container allows 'append' & 'remove'

