Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While building animated gifs I had some tracing on to make sure I wasn't introducing any leaks, and found some more that were pre-existing, but unrelated to animated GIFs.
The first was a cycle where hooking up the overlay in the file widget introduced a cycle that kept the file widget around even when the parent view was destroyed. I believe this one actually kinda works as-is, because the parent view in practice calls
dispose()
manually on the children, but that's a bit fragile and still isn't quite the same. But then when I implemented #1483 the parent became a standard Expander widget with no special handling, and then it was really broken. So this makes it so any standard widget can be the parent.The second was the "FileSendOverlay" which was created as a stack variable and then not referenced anywhere else. So that should have crashed immediately, but the leaking from the two callbacks in scope kept it around forever instead. So what I did here was actually reference it from the conversation view controller and then explicitly clear it after the overlay closes (with a slight delay, since that's in a handler on a signal on that object, and it crashes if I free it from that context). I can be a bit looser here because this
this
in this context is theConversationViewController
, which appears to functionally be a singleton.