titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

fix(ios): fixed ref counting of navTintColor

Open hbugdoll opened this issue 3 months ago • 1 comments

Fixes https://github.com/tidev/titanium-sdk/issues/14211.

Description:

  • https://github.com/tidev/titanium-sdk/commit/951877b29c0655a2f2e9d053d25ddfcdf464c7dd created a new issue setting navTintColor for a tab group, not for window
    • in this case newColor was set to a new object and was unretained when later released
  • fixed ref counting through use of a temporary object newTintColor inside the block to hold newColor
  • additionally fixed a potential memory leak by also releasing newColor if controller == nil

Successfully tested with both code examples https://github.com/tidev/titanium-sdk/issues/14211#issue-3023033146 and https://github.com/tidev/titanium-sdk/pull/13917#issue-1909950302 in simulator.

hbugdoll avatar Sep 30 '25 12:09 hbugdoll

Functional test: I've tested both examples and I don't see any crash with this PR 👍

m1ga avatar Sep 30 '25 13:09 m1ga