sammycage / lunasvg

lunasvg is a standalone SVG rendering library in C++
MIT License
818 stars 115 forks source link

Memory leak? #145

Closed g40 closed 7 months ago

g40 commented 7 months ago

Platform: VS2022 17.8.3, Windows 10x64 and a vanilla MFC dialog application.

[edit:] Should add this is with a static library built using the CMake derived vcxproj file

It appears to be the case that simply linking and referencing std::unique_ptr<lunasvg::Document> is enough to trigger a possible memory leak warning from the MFC infrastructure.

Unfortunately there is no trace data, so it may be a false positive. Removing the declaration removes the warning.

Are there any static allocations made inside the library?

R:\src\ui\modal\sshui.h(556): EndModal(): 0
Detected memory leaks!
Dumping objects ->
Object dump complete.
The thread 0x11ec has exited with code 0 (0x0).
The thread 0x7e98 has exited with code 0 (0x0).
The thread 0x6648 has exited with code 0 (0x0).
The thread 0x9114 has exited with code 0 (0x0).
The thread 0x9038 has exited with code 0 (0x0).
The program '[25348] Modal.exe' has exited with code 0 (0x0).
sammycage commented 7 months ago

Hello there! I appreciate your report regarding the possible memory leak warning with VS2022 and the MFC infrastructure. While I'm not familiar with Windows or Visual Studio intricacies, it's worth mentioning that memory handling is a critical concern.

I'd like to reassure you that the library follows the best coding standards. However, since there's no trace data and it might be a false positive, it could be beneficial to investigate further or consult experts familiar with Windows development to ensure everything is in order.

Let me know if there's anything more specific you'd like to convey or inquire about!

g40 commented 7 months ago

Going to close this as I've no data to share yet. Thanks for listening.