gnome-control-center/panels
Debarshi Ray 5579314a38 online-accounts: Track the lifecycle of CcGoaPanel across async calls
Due to an API bug in GNOME Online Accounts, the asynchronous
goa_provider_get_all method doesn't accept a GCancellable argument.
This makes it difficult to cancel an ongoing call when the CcGoaPanel
gets destroyed.

Prior to commit c26f8ae018, this was hacked around by taking a
reference on the panel for the duration of the call. Instead of
cancelling a pending call on destruction, it would keep the panel alive
until the call was over. However, that was lost during commit
c26f8ae018.

One thing to bear in mind is that GtkWidgets, CcGoaPanel is one, can
be destroyed by a gtk_widget_destroy call, which is subtly different
than a simple sequence of g_object_unref calls. When gtk_widget_destroy
is used, it invokes the GObject::dispose virtual method of the widget.
It is expected this will cause anything holding a reference to this
widget to drop their references, leading to GObject::finalize being
called. However, there is no guarantee that this will happen in the
same iteration of the GMainLoop. Therefore, it is possible that when
the goa_provider_get_all call finishes, the CcGoaPanel might be in a
disposed, but not yet finalized state.

When a GObject is in a disposed-but-not-finalized state, only a very
limited number of operations can be performed on it. Its reference
count can be altered, the memory used by the instance struct can be
accessed, but none of the member GObjects can be assumed to be valid.
eg., it's definitely illegal to add new rows to the member GtkListBox.
Hence a boolean flag is used to mark the destroyed state of the panel.

This second part is a small improvement over the earlier hack.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/208
2018-10-05 11:20:37 +02:00
..
background background: Replace deprecated GSimpleAsyncResult with GTask 2018-06-03 06:46:16 +04:00
bluetooth bluetooth: Allow the Bluetooth panel to reach narrower sizes 2018-09-24 10:05:36 +02:00
color color: Fix fallout from the GtkTemplate port 2018-09-15 17:30:44 +02:00
common common: Change language chooser layout to match design 2018-09-17 16:32:52 +00:00
datetime datetime: grayout automatic timezone 2018-09-11 02:11:44 +00:00
display display: Correctly add minor axis to snapping 2018-10-04 04:58:22 +00:00
info Revert "info: Cache D-Bus proxies" 2018-08-27 12:56:20 +00:00
keyboard common: update pixel_size values to base 16 for icon clarity 2018-07-10 17:52:08 -04:00
mouse mouse: Connect signal handlers swapped 2018-05-31 09:16:00 +12:00
network wifi: Don't translate placeholder text 2018-08-27 22:48:05 +00:00
notifications Revert "notification: Cache D-Bus proxy" 2018-08-27 12:56:20 +00:00
online-accounts online-accounts: Track the lifecycle of CcGoaPanel across async calls 2018-10-05 11:20:37 +02:00
power power: Handle cancelled kbd brightness proxy creation 2018-09-25 02:46:54 +00:00
printers printers: Fix printer delete signal passing an extra argument. 2018-09-17 16:07:48 +00:00
privacy Revert "privacy: Cache D-Bus proxies" 2018-08-27 12:56:20 +00:00
region region: Add description label and use icon for options button 2018-09-19 15:18:18 +00:00
search Simplify use of GCancellable 2018-06-01 21:03:19 +00:00
sharing sharing: Bind hostname_entry from UI 2018-09-21 16:59:25 +00:00
sound Add translator comments to .desktop files 2018-02-23 18:49:35 +01:00
thunderbolt thunderbolt: Fix build 2018-05-16 13:01:12 -05:00
universal-access universal-access: Use GtkTemplate 2018-06-11 14:11:47 +00:00
user-accounts user-accounts: Fix libpwquality error handling 2018-09-10 22:04:23 +00:00
wacom wacom: Remove unused tabs in UI 2018-08-27 02:55:21 +00:00
meson.build thunderbolt: new panel for device management 2018-04-13 15:08:16 +02:00