Skip to content

manager: Create manager in main thread

Mohammed Sadiq requested to merge pksadiq/gnome-notes:main-thread-manager into master

And adapt accordingly.

We were using GAsyncInitable to create the manager, and all signals were hooked in some different thread, which resulted in the variables in manager being accessed/modified both in non-UI thread and in UI thread (when manager methods were called by some UI thread). This could be the reason of occasional crashes happening to many.

So instead, always create the manager and load providers async, and add the providers in main thread itself. Also, make manager a plain GObject since we no longer require it to be initalized async.

In the future this can help let the main window be always shown and update according to the errors/status reported by the manager.

/cc @igaldino This could a fix for various crashes that was happening to many, but couldn't be reproduced.

Merge request reports