On Wed Aug 30 12:16:01 2023 +0000, Gabriel Ivăncescu wrote:
I mean knowing about task magics should be totally fine since it makes sense to remove all tasks associated with the object when it reaches 0? And task magic is how we use that. I can get rid of unconditional call to get_task_magic of course, simplifying this, on the assumption that Gecko never releases it directly (we have to assume that in the other case, anyway), if you prefer it that way. It relies more on internal gecko designs though. Still it would be simpler than adding ref and then decreasing it when last_release basically always boils down to remove_target_tasks and doesn't care about ref count at all. Also increasing refcount from 0 strikes me as odd in the first place. It works because of Gecko's design, but… just seems like it's over-engineered for no reason.
I think I'll use last_release without the addref/release between it, since we don't need it for now anyway. If we ever need it (though I find it very unlikely) it can be added, or the respective object itself could do it.
We will have to add support for shouldDelete at some later point though, just to be safe…