{
// setup signal handler and global flag to handle shutdown
g_LayerManagerRunning = true;
+
+ LOG_DEBUG("LayerManagerService", "Setup signal handling.");
signal(SIGBUS, signalHandler);
signal(SIGSEGV, signalHandler);
signal(SIGTERM, signalHandler);
}
bool started = pManager->startManagement(displayWidth, displayHeight, displayName);
- if (!started)
+ if (started)
{
- goto cleanup;
+ LOG_INFO("LayerManagerService", "Startup complete. EnterMainloop");
+
+ while (g_LayerManagerRunning)
+ {
+ CommunicatorListIterator commIter = communicatorList.begin();
+ CommunicatorListIterator commIterEnd = communicatorList.end();
+ for (; commIter != commIterEnd; ++commIter)
+ {
+ (*commIter)->process(100);
+ }
+ }
}
- // must stay within main method or else application would completely exit
- LOG_INFO("LayerManagerService", "Startup complete. EnterMainloop");
+ LOG_INFO("LayerManagerService", "Exiting Application.");
- while (g_LayerManagerRunning)
+ LOG_DEBUG("LayerManagerService", "Stopping service.")
+ pManager->stopManagement();
+
+ LOG_DEBUG("LayerManagerService", "Removing all scene provider plugins.")
{
- CommunicatorListIterator commIter = communicatorList.begin();
- CommunicatorListIterator commIterEnd = communicatorList.end();
- for (; commIter != commIterEnd; ++commIter)
+ SceneProviderList* pList = pManager->getSceneProviderList();
+ SceneProviderListIterator iter = pList->begin();
+ SceneProviderListIterator iterEnd = pList->end();
+
+ for (; iter != iterEnd; ++iter)
{
- (*commIter)->process(100);
+ ISceneProvider* sceneProvider = *iter;
+ pManager->removeSceneProvider(sceneProvider);
+ delete sceneProvider;
}
}
+ LOG_DEBUG("LayerManagerService", "Removing all communicator plugins.")
+ {
+ CommunicatorList* pList = pManager->getCommunicatorList();
+ CommunicatorListIterator iter = pList->begin();
+ CommunicatorListIterator iterEnd = pList->end();
- // cleanup
- cleanup:
+ for (; iter != iterEnd; ++iter)
+ {
+ ICommunicator* comm = *iter;
+ pManager->removeCommunicator(comm);
+ delete comm;
+ }
+ }
+
+ LOG_DEBUG("LayerManagerService", "Removing all renderer plugins.")
+ {
+ RendererList* pList = pManager->getRendererList();
+ RendererListIterator iter = pList->begin();
+ RendererListIterator iterEnd = pList->end();
+
+ for (; iter != iterEnd; ++iter)
+ {
+ IRenderer* renderer = *iter;
+ pManager->removeRenderer(renderer);
+ delete renderer;
+ }
+ }
- LOG_INFO("LayerManagerService", "Exiting Application.");
- pManager->stopManagement();
- //delete pRenderer; TODO
- //delete pCommunicator; TODO
delete pManager;
// reset signal handling to default
+ LOG_DEBUG("LayerManagerService", "Remove signal handling.");
signal(SIGBUS, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
signal(SIGTERM, SIG_DFL);