Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6601097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:42:33+00:00 2026-05-25T18:42:33+00:00

I been working in a project, but recently I check if my program has

  • 0

I been working in a project, but recently I check if my program has some leaking and the results is that it’s leaking and a lot.

I use _CrtDumpMemoryLeaks(); to receive all the messages of leaking and I check that most of them are related with boost, I know that it must be my problem, but I can’t understand why it’s leaking.

In the debug output shows me these lines:

Dumping objects ->
{673} normal block at 0x00E075E0, 8 bytes long.
 Data: <H   @e  > 48 92 E0 00 40 65 E0 00 
{671} normal block at 0x00E065C0, 8 bytes long.
 Data: <@e      > 40 65 E0 00 00 00 00 00 
{669} normal block at 0x00E06540, 68 bytes long.
 Data: < e  mountains.pn> C0 65 E0 00 6D 6F 75 6E 74 61 69 6E 73 2E 70 6E 
{665} normal block at 0x00E063B0, 8 bytes long.
 Data: <H       > 48 92 E0 00 00 00 00 00 
{663} normal block at 0x00E09248, 68 bytes long.
 Data: < c  nubes.png   > B0 63 E0 00 6E 75 62 65 73 2E 70 6E 67 00 CD CD 

Which leads me to believe that the problem is where I use those strings, and the first call with those are in these lines:

tutorialLevel->addLayerToList("nubes.png", 1600.f, 720.f, 1.0f, 0.0f, 0.1f, true);
tutorialLevel->addLayerToList("mountains.png", 1600.f, 720.f, speedXVectorPanda.at(0), 0.0f, 0.5f, false);

And the actual function addLayerToList is the next:

void Level::addLayerToList(std::string name, GLfloat widthLayer, GLfloat heightLayer, GLfloat velX, GLfloat velY, 
                GLfloat constantX, bool hasRepetition)
{
    layersList.push_back( new Layer(name, widthLayer, heightLayer, velX, velY, constantX, hasRepetition) );
}

And layersList is define like this:

boost::ptr_vector< Layer > layersList;

Maybe, I misunderstood how the ownership of pointers work in Boost, but in the examples I recently check, this is a correct way to pass ownership of the object to the ptr_vector, am I wrong?

And my other question is, if it’s necessary release the pointers for the vector, or it’s better leave the auto_ptr do his work?

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:42:34+00:00Added an answer on May 25, 2026 at 6:42 pm

    Depending on where you placed it but in almost all cases, _CrtDumpMemoryLeaks will not show you the truth when using STL/BOOST smart pointers. It will see the usage of new within the STL as a memory leak.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working with Struts for some time, but for a project I
I have been working on a project that has 2 interfaces - windows forms
I'm primarily a C++ developer, but recently I've been working on a project in
I've been working on a project that accesses the WMI to get information about
I've been working on a project that can't be described as 'small' anymore (40+
I've been working on a project of porting an old solaris CL program to
I've been working on an embedded C/C++ project recently using the shell in Tornado
I've been developing a couple of C# tools recently, but primarily working with a
I've recently been working on some database search functionality and wanted to get some
I've recently been working on a project using WPF to produce a diagram. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.