c++ - Memory problems -


I have some singleton classes (please do not talk about singleton use).

  Class Input Systems: Promotion :: Serialization :: Singleton & lt; InputSystem & gt; {Private: Promotion: Share_Pit & lt; Sf :: window & gt; MInputWindow; Public: Input Systems () {mInputWindow = boost :: shared_ptr & lt; Sf :: window & gt; (New SF :: windows (someARgs)); SomeMethod (); } Few methods () {mInputWindow-> ...) / sf :: calling some methods of window squares / everything is fine here} const sf :: input and handle () const {return mInputWindow.get ()) - & gt; GetInput (); }}; Zero main () {InputSystem :: get_mutable_instance (). the handle (); // All members of the input system have invalid addresses in memory (0x000)}  

What can be there?

Some method () is invalidating your class data, or you have misidentified this problem.

Change it to your main function:

  InputSystem & InputSystem = Input System :: get_mutable_instance (); inputSystem.Handle ();  

This creates the first attempt to build the Ontonon and use it on separate lines to its debugger Fire and seek exact point Take action through code in that your data on the data is corrupted.


Comments