Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23542] Memory-leaks and warnings across the iOS-project

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-04-24T22:37:58.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0, Release 6.0.4
ComponentsiOS
Labelsios, memoryleak, xcode
ReporterHans Knöchel
AssigneeHans Knöchel
Created2016-06-20T00:47:46.000+0000
Updated2017-04-24T22:39:01.000+0000

Description

We have around 70 memory-leaks that lie in the Titanium source project since years. We should resolve them all, as well as fixing the additional warnings regarding casting, unused variables etc.

Comments

  1. Hans Knöchel 2016-06-20

    PR: https://github.com/appcelerator/titanium_mobile/pull/8074 This PR will require a major testing environment...I would like to setup unit tests everywhere possible, since they are perfect for ensuring the proxy-correctness.
  2. Chee Kiat Ng 2016-07-05

    [~hansknoechel] any great ideas how we can check and test this?
  3. Hans Knöchel 2016-07-23

    Well, most of it deals with objects that have not been deallocated in the dealloc method. In addition, Titanium proxies usually get autoreleased (e.g TiBlob). Not sure what's the best way to setup test-cases.
  4. Chee Kiat Ng 2016-07-28

    Have put some comments in PR. I prefer to push this to a later version so i can take a more extensive look at each fix you included, because I'm pretty sure some these 'leaks' were intentional.
  5. Chee Kiat Ng 2016-12-07

    PR Here: https://github.com/appcelerator/titanium_mobile/pull/8663

    To Test

    1. Open the iPhone Xcode project in the titanium SDK. 2. Choose Product->Analyse.

    Expected Results

    There will be no more static analyzer warnings Also, check to see all Jenkins unit tests has passed successfully.
  6. Hans Knöchel 2016-12-07

    We need test-cases for every API that is affected by this changes: - Ti.Calendar (any API) - Ti.Filesysten.getAsset() - Any native module (just see that it loads) - Ti.Media.requestPhotoGalleryPermissions() - Ti.App.shortcutItems event shortcutitemclick - Ti.App.iOS.scheduleLocalNotification() - Ti.App.iOS.SearchQuery - Ti.UI.iOS.PreviewContext - Ti.UI.TextField.hintTextColor - Ti.UI.WebView.data - Ti.UI.iOS.createLivePhotoBadge - Ti.UI.ActivityIndicatorStyle We need an actual test-app for this, since simple unit-tests won't catch possible errors due to retain-cycles that might only occur in a specific context. I will help providing the above test-cases.
  7. Hans Knöchel 2016-12-07

    Test-Case (wip): https://gist.github.com/hansemannn/108aaa09c478f53be9174d2d169e94fb
  8. Chee Kiat Ng 2016-12-15

    PR for unit tests: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/15
  9. Abir Mukherjee 2017-04-24

    Testing with this environment, and not able to run Product>Analyze succesfully: Node Version: 6.10.1 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.0 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.0.3.GA Xcode 8.2.1 After choosing Product > Analyze, the following 5 errors were seen: cp: /Users/amukherjee/Library/Application Support/Titanium/mobilesdk/osx/6.0.4/iphone/iphone/../../demos/KitchenSink/Resources/.: No such file or directory cp: /Users/amukherjee/Library/Application Support/Titanium/mobilesdk/osx/6.0.4/iphone/iphone/../Resources/modules/facebook/.: No such file or directory cp: /Users/amukherjee/Library/Application Support/Titanium/mobilesdk/osx/6.0.4/iphone/iphone/../Resources/modules/ui/.: No such file or directory /Users/amukherjee/Library/Developer/Xcode/DerivedData/Titanium-douwoqomfrhjgpbvwlwoeewhzxfk/Build/Intermediates/Titanium.build/Debug-iphoneos/Titanium.build/Script-241EAF36118E30260081A5BE.sh: line 7: /Users/amukherjee/Library/Application Support/Titanium/mobilesdk/osx/6.0.4/iphone/iphone/../../support/common/localecompiler.py: No such file or directory /Users/amukherjee/Library/Developer/Xcode/DerivedData/Titanium-douwoqomfrhjgpbvwlwoeewhzxfk/Build/Intermediates/Titanium.build/Debug-iphoneos/Titanium.build/Script-241EAF36118E30260081A5BE.sh: line 8: /Users/amukherjee/Library/Application Support/Titanium/mobilesdk/osx/6.0.4/iphone/iphone/../../support/common/css/csscompiler.py: No such file or directory
  10. Hans Knöchel 2017-04-24

    Something is wrong with your PR-copy. I was able to successfully analyse, build, compile and package for iOS. Your error looks like you still have parts of the master / non 6_0_X branch in your Xcode cache. Ensure to clean your build (CMD+Shift+K) and your build folder (CMD+Shift+Alt+K).
  11. Abir Mukherjee 2017-04-24

    Passed FR with this environment: Node Version: 6.10.1 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.0 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.0.4 Xcode 8.2 I ran Analyzer in Xcode on Titanium.xcodeproj and found no errors. Warnings were generally on deprecation warnings. Closing this ticket as fixed. Changes were verified to be found in SDK 6.0.4.v20170424150521.

JSON Source