Archived

This topic is now archived and is closed to further replies.

RuneLancer

Problems with DirectMusic

Recommended Posts

Well, this sucks. I can''t figure this one out.
	if(DM_Performance)
	{
		DM_Performance->Stop(NULL, NULL, 0, 0);
		DM_Performance->CloseDown();
	}
	if(DM_Segment	 ) DM_Segment	 ->Release();
	if(DM_Loader	 ) DM_Loader	 ->Release();
	if(DM_Performance) DM_Performance->Release(); 
I load a midi and play it; everything works out just fine. The music plays, things run fine, everything''s good. Then when I shut down, the moment it hits the DM_Performance->Stop() it decides to crash (access violation). This works fine in my other project and I can''t see what''s wrong, really. Any suggestions?

Share this post


Link to post
Share on other sites
Neeever mind, found it. I was somehow calling my Deinitalise function twice when quitting (once when the user opts to quite and once when an SDL_QUIT is received) so it was being ->Release()''ed twice. The second time around, since it was invalid, it crashed.

I just added a DM_Segment = NULL; etc to everything and it ran fine.

Share this post


Link to post
Share on other sites