Skip to content

metadata-manager: Remove singleton

GeditDocument may attempt to use GeditMetadataManager after GeditApplication has already called gedit_data_manager_shutdown. This happens because right now _gedit_tab_load is not cancelled when the tab is closed, but it's only cancelled if the user dismisses the loading operation from the infobar.

Also cancelling _gedit_tab_load is not enough because GtkSourceFileLoader increases the reference count of the source buffer (in the case the GeditDocument) until the async operation is completed or cancelled, hence GeditDocument will attempt to use GeditMetadataManager in gedit_document_dispose after GeditApplication has already called gedit_data_manager_shutdown.

To properly solve this - and avoid similar issues - make GeditMetadataManager reference countable and keep an hard reference in each GeditDocument and in the GeditApp.

Closes: #145 (closed)

Merge request reports