Opened 6 years ago

Closed 6 years ago

#1010 closed Bug Report (fixed)

Segfault after deleting Ganv::Canvas

Reported by: anonymous Owned by: David Robillard
Priority: major Component: Ganv
Keywords: Cc:

Description

I created a std::vector of std::unique_ptr<ganv::Canvas> and erase()’d any element I was finished with. After doing this the program always crashed eventually with a SIGSEGV in GanvCanvasImpl::on_animate_timeout(). Seems as if the animation timeout function has to be removed (it’s not removed by g_idle_remove_by_data()).

Canvas.cpp: ~GanvCanvasImpl?(){ while (g_idle_remove_by_data(this)) ; g_source_remove(_animate_idle_id); added ganv_canvas_clear(_gcanvas); gdk_cursor_unref(_move_cursor); } This has solved the issue for me.

Attachments (1)

canvas_cpp_changes.patch (343 bytes) - added by anonymous 6 years ago.
patch

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by anonymous

Attachment: canvas_cpp_changes.patch added

patch

comment:1 Changed 6 years ago by anonymous

Updated above with patch

comment:2 Changed 6 years ago by David Robillard

That's weird, it should be removed by g_idle_remove_by_data, the data is the impl.

Oh well, can't hurt. Fixed in r5609, but with the order swapped to avoid a glib warning due to dual removal, and in the other place this happens as well.

Thanks.

comment:3 Changed 6 years ago by David Robillard

Component: OtherGanv
Resolution: fixed
Status: newclosed
Summary: Ganv: Segfault after deleting Ganv::CanvasSegfault after deleting Ganv::Canvas
Note: See TracTickets for help on using tickets.