[TIMOB-23542] Memory-leaks and warnings across the iOS-project
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-04-24T22:37:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0, Release 6.0.4 |
Components | iOS |
Labels | ios, memoryleak, xcode |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2016-06-20T00:47:46.000+0000 |
Updated | 2017-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.
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.
[~hansknoechel] any great ideas how we can check and test this?
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.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.
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.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.Test-Case (wip): https://gist.github.com/hansemannn/108aaa09c478f53be9174d2d169e94fb
PR for unit tests: https://github.com/appcelerator/titanium-mobile-mocha-suite/pull/15
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
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).
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.