toga icon indicating copy to clipboard operation
toga copied to clipboard

Resolve remaining iOS widget memory leaks.

Open freakboy3742 opened this issue 1 year ago • 2 comments

A follow up to #2850; this resolves the remaining widget memory leaks on iOS.

The underlying issue is one that has been previously solved on macOS, but the fix wasn't ported to iOS. Constraint objects are ObjC instances that are referenced by ObjC widgets; however, if the underlying widget is garbage collected before the constraint, the widget reference no longer exists, and so it can't be removed from the constraint. This causes a segfault when the constraint is disposed.

macOS added a fix for this some time ago; but the same fix wasn't applied to iOS. This ports the fix over to iOS, which then in turn allows the remaining iOS memory leaks to be resolved.

Refs #2849.

PR Checklist:

  • [x] All new features have been tested
  • [x] All new features have been documented
  • [x] I have read the CONTRIBUTING.md file
  • [x] I will abide by the code of conduct

freakboy3742 avatar Sep 16 '24 22:09 freakboy3742

Unfortunately it's still crashing in or immediately after test_optioncontainer, and the rerun is the same.

mhsmith avatar Sep 17 '24 12:09 mhsmith

Whelp... thought I had it. Back to the drawing board, I guess...

freakboy3742 avatar Sep 17 '24 12:09 freakboy3742

With the changes in Rubicon 0.5.0, the remaining iOS memory leaks have now been resolved.

freakboy3742 avatar Jan 07 '25 02:01 freakboy3742