On Fri Aug 18 12:57:59 2023 +0000, Jacek Caban wrote:
It looks like we will need an equivalent of Gecko's `NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE`. The problem with your patch is that if deletion happens, you're accessing a freed object. Gecko avoids that by explicitly requesting not to delete it with `shouldDelete` and does the deletion later if needed. Unfortunately, that would require Gecko interface extension.
That shouldn't be a problem since we call `remove_target_tasks` when unlinking/deleting it, which gets rid of the task, unless I'm missing something?
I mean I could call `remove_target_tasks` instead of incrementing `magic`, but it seems like pointless overhead because it will be called again anyway during unlink/delete.