PacktPublishing / Mastering-Graphics-Programming-with-Vulkan

MIT License
514 stars 65 forks source link

Memory leak in Chapter 5 #30

Closed dorian-apanel-intel closed 1 year ago

dorian-apanel-intel commented 1 year ago

To reproduce:

  1. Compile and run chapter 5 from debugger.
  2. After cloth is seen, close main window (x)
  3. Observe assert trigerred:

RASSERTM( stats.allocated_bytes == 0, "Allocations still present. Check your code!" ); stats.allocated_bytes is 0x240

DebugOutput tail:

Gpu Device shutdown
InputService shutdown
The thread 0x7588 has exited with code 0 (0x0).
'RaptorEngine_Chapter5_Debug.exe' (Win32): Unloaded 'C:\Windows\System32\avrt.dll'
The thread 0x5770 has exited with code 0 (0x0).
WindowService shutdown
Found active allocation 000002AA35888240, 576
HeapAllocator Shutdown.
===============
FAILURE! Allocated memory detected. allocated 576, total 2147483648
===============

D:\testsuites\Mastering-Graphics-Programming-with-Vulkan\source\raptor\foundation\memory.cpp(156) : Allocations still present. Check your code!

Callstack:

>   RaptorEngine_Chapter5_Debug.exe!raptor::HeapAllocator::shutdown() Line 156  C++ Symbols loaded.
    RaptorEngine_Chapter5_Debug.exe!raptor::MemoryService::shutdown() Line 61   C++ Symbols loaded.
    RaptorEngine_Chapter5_Debug.exe!main(int argc, char * * argv) Line 480  C++ Symbols loaded.
    RaptorEngine_Chapter5_Debug.exe!invoke_main() Line 79   C++ Non-user code. Symbols loaded.
    RaptorEngine_Chapter5_Debug.exe!__scrt_common_main_seh() Line 288   C++ Non-user code. Symbols loaded.
    RaptorEngine_Chapter5_Debug.exe!__scrt_common_main() Line 331   C++ Non-user code. Symbols loaded.
theWatchmen commented 1 year ago

Thanks, I noticed this today as well. This has now been fixed.