Skip to content

Fix object ownership in the wrapper of the render signal.

Baldvin Kovacs requested to merge baldvin.kovacs/gtkmm:master into master

This change ensures that the wrapper implementation of the render signal emission does not take ownership of the underlying cairo_region_t C instance. It is necessary, because the C implementation expects to keep ownership, and destroys the underlying C instance after the signal was emitted.

The wrapped signal is emitted from gdk_surface_process_update_internal.

The relevant lines:

expose_region = cairo_region_copy (surface->active_update_area);

// here expose_region has a reference count of 1

g_signal_emit (surface, signals[RENDER], 0, expose_region, &handled);

// ...and here it needs to remain one, but with the current implementation // we get a double destroy below:

cairo_region_destroy (expose_region);

Merge request reports