Search code examples
c++memoryvisual-c++skia

memory assert when delete SkCanvas object


When I use "delete mCanvas" to delete a SkCanvas object, debug with VS2022, I get a memory assert "A breakpoint instruction was executed".

From the stack, "skia.dll!SkCanvas::vector deleting destructor(unsigned int)" is being called. Why does this happen? How should we delete SkCanvas object?

Thanks


Solution

  • I needed to build skia with extra_cflags=["/MDd"] when in debug mode. This solved my issue.