The main code has been written 9 years ago and been running fine with little maintenance over the years. Recently I’ve been getting issues relating to the error mentioned in the title. I’ve trying to understand more why this is happening and why.
Example of a error log:
(gjs:4581): Gjs-CRITICAL **: 01:15:51.510: Attempting to call back into JSAPI during the sweeping phase of GC. This is most likely caused by not destroying a Clutter actor or Gtk+ widget with ::destroy signals connected, but can also be caused by using the destroy(), dispose(), or remove() vfuncs. Because it would crash the application, it has been blocked and the JS callback not invoked. (gjs:4581): Gjs-CRITICAL **: 01:15:51.510: The offending signal was process-key-event on IBusEngine 0x55ad961c9230.
I think the gjs code behind this is in https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/value.cpp#L145 .