Skip to main content
gamedev.net
🔒 Locked

Releasing Problem

Started by Yaskil Jul 30, 2001 at 7:32 AM 1 replies 250+ views
Original Post
Yaskil
Yaskil
i have written a new ddraw7 class.it has members m_lpdd (direct draw obj) m_lpddsprimary (front buffer) m_lpddsback( back buffer). It also supports windowed mode to full screen mode switching. in class destructor i have written a code similar to below one.
  
CDirectXApp::~CDirectXApp()
{
   if( m_lpdd != NULL )
   {
       if( m_lpddsback != NULL )
       {
           m_lpddsback->Release();
           m_lpddsback = NULL;
       }

       if( m_lpddsprimary != NULL )
       {
           m_lpddsprimary->Release();
           m_lpddsprimary = NULL;
       }

      m_lpdd->Release();
      m_lpdd = NULL;
   }
}
  
but on the time destruction i get famous Access Violation 0x000005 error message. i couldn't find the error if any one helps it could be fine... Life is beautiful Edited by - yaskil on July 30, 2001 8:39:15 AM
Life is beautiful
Gilzu
Gilzu
i remember doing that made the same error.
it pops at the second buffer being dispised.

what i did?
i didnt release any,
it should b automatically released when you
release your ddraw object.

Gil
[email=gil@gilzu.com]Gil Zussman[/email]Check out Goose Chase, Coming this fall!http://www.gilzu.com
Buster
Buster
Don''t release the back buffer, it gets released when you release the primary surface.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.