CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Exception thrown in release mode

  1. #1
    Join Date
    May 2015
    Posts
    311

    Exception thrown in release mode

    Hello,
    Hope you remember that, I am trying to use the little debug info in the Release mode, as our setup does not allow to run in debug mode with some configurations (I am just following the instructions, have to check, may be once we start the office )

    Btw, after my earlier post, with some fixes, it worked. But now some changes from the customers, on some of the configurations, I am getting the exception being thrown in the for loop as below.
    The for loop is iterating over the set. Not sure why it is throwing the exception there.

    snippet of the code is :
    Code:
     // Somewhere in header file 
    	std::set<int>	m_sSparseSections;	// section-number of each sparse section in this raster
    	
    	
    bool PredictionRaster::Finalise()
    {
    	bool bTypedSOCompressedOk = true;
    	//Compress and remove sections that are in m_sSparseSections
    	for (auto iter = m_sSparseSections.begin(); iter != m_sSparseSections.end(); ++iter)
    	{
    		auto FullDataIter = m_cSectionRasters.find(*iter);
    		if (FullDataIter != m_cSectionRasters.end())
    		{
    ::::::
    ::::::::
    		}
    ::::::
    
    	}	
    }
    The error msg is:

    Exception thrown: read access violation.this was nullptr.

    Btw, when this exception is thrown, I could put the curzor on the set and I am getting the
    m_sSparseSections { size=??? }

    Does it mean the m_sSparseSections is not initialised and has some garbage in it !!!!

    Could you please help me with inputs. Will be very helpful, as has always been here ..

    { Btw this is not my change, it is some legacy code already there , may be new config is triggering this }

    Thanks a lot
    pdk
    Last edited by pdk5; July 17th, 2020 at 04:07 PM.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,785

    Re: Exception thrown in release mode

    The instance of PredictionRaster is nullptr?
    Victor Nijegorodov

  3. #3
    Join Date
    May 2015
    Posts
    311

    Re: Exception thrown in release mode

    Thanks a lot Victor, yes seems so ! , not sure how it happen !

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,785

    Re: Exception thrown in release mode

    Quote Originally Posted by pdk5 View Post
    Thanks a lot Victor, yes seems so ! , not sure how it happen !
    Well, sometimes **** happens...
    Victor Nijegorodov

  5. #5
    Join Date
    May 2015
    Posts
    311

    Re: Exception thrown in release mode

    Thanks a lot Victor, , yes you are right, just checked and the pointer is indeed NULL
    Last edited by pdk5; July 17th, 2020 at 05:30 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)