Relative Content

Tag Archive for c++memory-leaks

Memory issue with pictureBox.ImageLocation C#

I’m Making overlay program displays pictures on semi-transparent form depending on what key was pressed. The way i decided to do this: make second form(first form contains setting, menu, etc.), use GlobalKeyboardHook(because i need it to work while form is not focused), assign specified image in picturebox.imageslocation every time arrow key is pressed(idk if it’s the best way to do this).

Using _CrtDumpMemoryLeaks to detect memory leaks in C++ DLL

Our C# code is calling an unmanaged C++ DLL. I want to have the ability to catch all unmanaged memory leaks that may occur while we’re using the unmanaged code. May I call _CrtSetDbgFlag at the start of the C++ DLL’s initialization function and obtain meaningful results by calling _CrtDumpMemoryLeaks at the end of the shutdown function?

Function takes progressively longer to execute over time C#

I have been trying to trace down a memory leak in my program and every method I have timed thus far has been as predicted and constant except for this one. As I leave the program running the time to execute the IsValid() method takes progressively longer as the program runs, gaining 1ms every 30 seconds or so. I am using StopWatch to time the execution of the function and I am only iterating on 1 object that always return true. The GetBestGoal() method is being called 60 times per second and there is only one object in the list of goals for simplicity.