Commit 271f858b authored by Christian Hergert's avatar Christian Hergert
Browse files

buffer: keep IdeObject alive during save

We need to ensure our IdeObjectBox is not disposed (and removed from graph)
during a save operation.
parent bef094f8
......@@ -1588,6 +1588,14 @@ ide_buffer_save_file_async (IdeBuffer *self,
ide_task_set_source_tag (task, ide_buffer_save_file_async);
ide_task_set_task_data (task, state, save_state_free);
/* Keep buffer alive during save operation */
ide_buffer_hold (self);
g_signal_connect_object (task,
"notify::completed",
G_CALLBACK (ide_buffer_release),
self,
G_CONNECT_SWAPPED);
if (self->state == IDE_BUFFER_STATE_SAVING)
{
/* TODO: We could save in-flight tasks and chain to them */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment