GdsOutputrenderer: progress-changed signal: Status message is now freed inside the GdsOutputRenderer.

This is safe because the signals are handled back to back inside the emit function. Therefore, it can be freed directly after emission. This solves the problem of the status message not being freed if no handler is connected to the signal.
This commit is contained in:
2019-08-24 13:45:16 +02:00
parent 94ac44ddc5
commit 17af08b04d
2 changed files with 2 additions and 3 deletions

View File

@@ -405,7 +405,7 @@ static gboolean idle_event_processor_callback(gpointer user_data)
priv = gds_output_renderer_get_instance_private(renderer);
if (g_mutex_trylock(&priv->idle_function_parameters.message_lock)) {
status_message = g_strdup(priv->idle_function_parameters.status_message);
status_message = priv->idle_function_parameters.status_message;
g_signal_emit(renderer, gds_output_renderer_signals[ASYNC_PROGRESS_CHANGED], 0, status_message);
g_free(priv->idle_function_parameters.status_message);
priv->idle_function_parameters.status_message = NULL;