diff --git a/src/servers/media/MMediaFilesManager.cpp b/src/servers/media/MMediaFilesManager.cpp index ad92d252ec..18a2c39308 100644 --- a/src/servers/media/MMediaFilesManager.cpp +++ b/src/servers/media/MMediaFilesManager.cpp @@ -27,7 +27,6 @@ MMediaFilesManager::~MMediaFilesManager() { CALLED(); delete fRunner; - SaveState(); delete fRegistryMap; delete fLocker; } @@ -144,6 +143,7 @@ MMediaFilesManager::LoadState() status_t MMediaFilesManager::SaveState() { + CALLED(); status_t err = B_OK; BPath path; if((err = find_directory(B_USER_SETTINGS_DIRECTORY, &path))!=B_OK) @@ -181,7 +181,9 @@ MMediaFilesManager::SaveState() file.Write(&zero, sizeof(uint32)); } file.Write(&zero, sizeof(uint32)); - + + printf("save state ok\n"); + return B_OK; } diff --git a/src/servers/media/media_server.cpp b/src/servers/media/media_server.cpp index 85be0a24cf..cd3f936cc9 100644 --- a/src/servers/media/media_server.cpp +++ b/src/servers/media/media_server.cpp @@ -107,7 +107,7 @@ private: BLocker *fLocker; - void MessageReceived(BMessage *msg); + virtual void MessageReceived(BMessage *msg); typedef BApplication inherited; }; @@ -171,6 +171,7 @@ bool ServerApp::QuitRequested() { TRACE("ServerApp::QuitRequested()\n"); + gMMediaFilesManager->SaveState(); gNodeManager->SaveState(); gAppManager->TerminateAddonServer(); return true; @@ -691,7 +692,8 @@ ServerApp::controlthread(void *arg) return 0; } -void ServerApp::MessageReceived(BMessage *msg) +void +ServerApp::MessageReceived(BMessage *msg) { TRACE("ServerApp::MessageReceived %lx enter\n", msg->what); switch (msg->what) { @@ -699,9 +701,9 @@ void ServerApp::MessageReceived(BMessage *msg) case MEDIA_SERVER_CANCEL_NOTIFICATIONS: gNotificationManager->EnqueueMessage(msg); break; case MEDIA_SERVER_SEND_NOTIFICATIONS: gNotificationManager->EnqueueMessage(msg); break; case MMEDIAFILESMANAGER_SAVE_TIMER: gMMediaFilesManager->TimerMessage(); break; - default: - printf("\nnew media server: unknown message received\n"); - msg->PrintToStream(); + default: inherited::MessageReceived(msg); break; + //printf("\nnew media server: unknown message received\n"); + //msg->PrintToStream(); } TRACE("ServerApp::MessageReceived %lx leave\n", msg->what); }