sugarlabs / write-activity

A simple word processor for the Sugar learning environment
GNU General Public License v2.0
2 stars 25 forks source link

GObject GSignal instance has no handler with id #45

Open quozl opened 1 year ago

quozl commented 1 year ago

On Raspberry Pi OS, the Write activity logs

/usr/lib/python3/dist-packages/gi/overrides/GObject.py:412: Warning: ../../../gobject/gsignal.c:2654: instance '0x23d09b0' has no handler with id '2370'
  GObjectModule.signal_handler_block(obj, handler_id)
/usr/lib/python3/dist-packages/gi/overrides/GObject.py:493: Warning: ../../../gobject/gsignal.c:2696: instance '0x23d09b0' has no handler with id '2370'
  return func(*args, **kwargs)

No impact.

drLite35 commented 8 months ago

This is related to checking if handler_id is connected before disconnect.

            abi.handler_block(self._abi_handler)
            try:
                logging.debug('Do abi %s' % do_abi_cb)
                do_abi_cb()
            finally:
                abi.handler_unblock(self._abi_handler)

we also need to store

self._connected_handlers = [self._abi_handler]

then disconnect if connected

def disconnect_signal(self):
        if self._abi_handler in self._connected_handlers:
            abi.disconnect(self._abi_handler)
            self._connected_handlers.remove(self._abi_handler)

I am unsure if i should generate pr.

quozl commented 8 months ago

The explanation seems reasonable. But I don't understand "unsure". What information do you need to make a pull request?

drLite35 commented 8 months ago

ok, will generate pr for review.