Archived

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

Yaskil

Releasing Problem

Recommended Posts

Yaskil    122
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

Share this post


Link to post
Share on other sites
Gilzu    122
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

Share this post


Link to post
Share on other sites