~ubuntu-branches/debian/wheezy/brasero/wheezy

« back to all changes in this revision

Viewing changes to libbrasero-media/brasero-gio-operation.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Henriksson
  • Date: 2009-10-27 14:03:16 UTC
  • mfrom: (1.2.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20091027140316-q8g6v1678zwg6748
Tags: 2.28.2-1
* New upstream bugfix release.
  - Upstream patch 030_fd_leak.patch dropped.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
                        g_error_free (operation->error);
149
149
                        operation->error = NULL;
150
150
                }
151
 
                else if (error)
 
151
                else if (error && (*error) == NULL)
152
152
                        g_propagate_error (error, operation->error);
153
153
                else
154
154
                        g_error_free (operation->error);
155
155
 
156
156
                operation->error = NULL;
157
157
        }
158
 
        g_cancellable_reset (operation->cancel);
 
158
 
159
159
        g_object_unref (operation->cancel);
160
 
 
161
160
        return operation->result;
162
161
}
163
162
 
242
241
                                                     G_CALLBACK (brasero_gio_operation_umounted_cb),
243
242
                                                     op);
244
243
 
 
244
                /* NOTE: we own a reference to mount
 
245
                 * object so no need to ref it even more */
245
246
                g_mount_unmount (mount,
246
247
                                 G_MOUNT_UNMOUNT_NONE,
247
248
                                 cancel,
324
325
                BraseroGioOperation *op;
325
326
 
326
327
                op = g_new0 (BraseroGioOperation, 1);
327
 
                op->cancel = cancel;
 
328
                op->cancel = cancel;
328
329
 
 
330
                /* Ref gvolume as it could be unreffed 
 
331
                 * while we are in the loop */
 
332
                g_object_ref (gvolume);
 
333
 
329
334
                g_volume_mount (gvolume,
330
335
                                G_MOUNT_MOUNT_NONE,
331
336
                                operation,                              /* authentification */
333
338
                                brasero_gio_operation_mount_finish,
334
339
                                op);
335
340
                result = brasero_gio_operation_wait_for_operation_end (op, error);
 
341
 
 
342
                g_object_unref (gvolume);
336
343
        }
337
344
        else {
338
345
                g_volume_mount (gvolume,
405
412
                                              G_CALLBACK (brasero_gio_operation_removed_cb),
406
413
                                              op);
407
414
 
 
415
                /* Ref gvolume as it could be unreffed 
 
416
                 * while we are in the loop */
 
417
                g_object_ref (gvolume);
 
418
 
408
419
                g_volume_eject (gvolume,
409
420
                                G_MOUNT_UNMOUNT_NONE,
410
421
                                cancel,
415
426
                g_signal_handler_disconnect (gvolume, eject_sig);
416
427
 
417
428
                brasero_gio_operation_destroy (op);
 
429
 
 
430
                g_object_unref (gvolume);
418
431
        }
419
432
        else {
420
433
                g_volume_eject (gvolume,
488
501
                               brasero_gio_operation_eject_finish,
489
502
                               op);
490
503
 
 
504
                /* Ref gdrive as it could be unreffed 
 
505
                 * while we are in the loop */
 
506
                g_object_ref (gdrive);
 
507
 
491
508
                result = brasero_gio_operation_wait_for_operation_end (op, error);
492
509
                brasero_gio_operation_destroy (op);
493
510
                g_signal_handler_disconnect (gdrive, eject_sig);
494
 
                g_signal_handler_disconnect (gdrive, disconnect_sig);
 
511
                g_signal_handler_disconnect (gdrive, disconnect_sig);
 
512
 
 
513
                g_object_unref (gdrive);
495
514
        }
496
515
        else {
497
516
                g_drive_eject (gdrive,