Skip to content

Fix memory leak in 3D renderer

Werni requested to merge Werni2A/kicad:fix_mem_leak_in_3d_renderer into master

Previously m_board_with_holes was not deleted when the destructor was called.

Stack trace before this fix:

Direct leak of 44 byte(s) in 1 object(s) allocated from:
    #0 0x7fd554260947 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.5+0x10f947)
    #1 0x7fd531518b07 in C3D_RENDER_OGL_LEGACY::createBoard(SHAPE_POLY_SET const&, CBVHCONTAINER2D const*) /home/dom/Desktop/git/Forks/kicad/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp:440
    #2 0x7fd531519995 in C3D_RENDER_OGL_LEGACY::reload(REPORTER*, REPORTER*) /home/dom/Desktop/git/Forks/kicad/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp:496
    #3 0x7fd5313594e3 in C3D_RENDER_OGL_LEGACY::Redraw(bool, REPORTER*, REPORTER*) /home/dom/Desktop/git/Forks/kicad/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp:566
    #4 0x7fd531317ba9 in EDA_3D_CANVAS::DoRePaint() /home/dom/Desktop/git/Forks/kicad/3d-viewer/3d_canvas/eda_3d_canvas.cpp:513
    #5 0x7fd53131c7ab in EDA_3D_CANVAS::OnRefreshRequest(wxEvent&) /home/dom/Desktop/git/Forks/kicad/3d-viewer/3d_canvas/eda_3d_canvas.cpp:905
    #6 0x7fd553659640 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0+0x20b640)

Merge request reports

Loading