Slick Forums

Discuss the Slick 2D Library
It is currently Wed May 22, 2013 1:58 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Jan 20, 2011 11:08 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
Our games are not releasing the sounds/musics (they kept playing until they finish) when the applet is closed, I dunno why exactly, I took a look at the code and I found AL.destroy() was called on AppGameContainer but not on AppletGameContainer but I am not sure if it should be.

If this is intentional, as a user of slick2d, which is the best way to call dispose/destroy of subsystems? (I mean for example: on destroy() of GameContainer or something like that)

Thanks.

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2011 11:24 pm 
Offline
Game Developer
User avatar

Joined: Sun Nov 12, 2006 8:40 pm
Posts: 574
looks like your right.

AppletGameContainer should have an AL.destroy(); in the runLoop() method after Display.destroy(), so should look like

Code:
/**
       * The running game loop
       *
       * @throws Exception Indicates a failure within the game's loop rather than the framework
       */
      public void runloop() throws Exception {
         while (running) {
            int delta = getDelta();

            updateAndRender(delta);

            updateFPS();
            Display.update();
         }

         Display.destroy();
         AL.destroy();
      }


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2011 12:26 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Thanks kappa!

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2011 1:01 pm 
Offline
Regular
User avatar

Joined: Tue Apr 07, 2009 12:58 pm
Posts: 232
Location: Uruguay
you are welcome!!

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group