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 7035241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:16:52+00:00 2026-05-28T01:16:52+00:00

Or at least I think the problem involves some kind of memory error. I’m

  • 0

Or at least I think the problem involves some kind of memory error. I’m making a program in SFML and I’m currently working on the menus using a GUI class that I made just for SFML. Internally, the GUI class uses std::shared_ptr to manage all of its internal pointers. The program consistently crashes after main() exits and all global destructors have been called, and gdb says a break point was triggered in ntdll!WaitForAlpCompletion, which leads me to believe that the problem is memory corruption. Whenever I remove the GUI instantiation from the menu function, it exits and closes with no errors. This seems to indicate GUI as the cause of the crash, except that sub-menus which create and destroy their own instances of GUI can be called and exited without any crashes or break points.

Some psuedocode:

SubMenu
{
    Create GUI
        Do Menu
    Destroy GUI
}

Menu
{
    Create GUI
        Do Menu?SubMenu
    Destroy GUI
}

main
{
    Init Stuff
    Menu
    UnInit Stuff
    Destroy GUI
    return 0
}

//after return
Global Dtors
Breakpoint triggered???

I’m at a loss as to what this could be. I plan on using some memory debugger like valgrind sometime today, but I was wondering if anyone else had any ideas on what this could be.

  • 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-28T01:16:52+00:00Added an answer on May 28, 2026 at 1:16 am

    A heap corruption can be caused with this code:

    int main()
    {
        int *A(new(std::nothrow) int(10));
        int *B(A);
    
        delete B;
        delete A;
    }
    

    Does any of your code contain this similar situation?

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

Sidebar

Related Questions

I understand the overall meaning of pointers and references(or at least I think i
I've just wrapped my head around monads (at least I'd like to think I
This is kind of a weird question, at least for me, as I don't
I'm using jagged arrays and have a bit of a problem (or at least
Greetings, I am currently exploring some extreme programming and try to stick as much
I have written presumably some of the first code to modify the memory of
I'm working on a project that involves creating a spline from a defined set
In this case, I'm working on a project that involves a database of library
For some school groupwork, I'm making a Generic Pizza Delivery Everything Management System, and
I am currently working on a project which has to use WebSockets as a

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.