-
Notifications
You must be signed in to change notification settings - Fork 618
resolve (most) mac static analyzer issues #414
Conversation
…identified by the Xcode static analyzer
There are definitely some other leaks in the mac version of brackets-shell and I'm planning to look into fixing some of those but wanted to send this pull request since this deals solely with those issues identified by the static analyzer. |
@btjones What other leaks did the static analysis find? |
Brackets target issues:
appshell_helper_app target issues:
|
…ory right away instead of waiting on the autorelease pool
Added another commit that explicitly releases an object so that it will get released right away instead of waiting on the autorelease pool. Reran all the Brackets Jasmine tests successfully. |
Hey - sorry for the lack of response. I'll try to raise the visibility of this PR with the team, although we're a bit slammed right now so it might still be a bit before we get to it. Thanks for looking into this. |
@btjones I'm going to have a look at it right now |
Might want @JeffryBooher to weigh in as well since I think he wrote most of the code that's modified by this PR. |
This needs extensive testing. The changes look OK from my quick initial pass but I can give this branch a whirl this afternoon |
I'm going to work with the shell as much as I can to figure out any issues (if any). |
cc: @bobeast |
The changes in the areas I'm familiar with look reasonable. |
@JeffryBooher @btjones @njx I used the shell now for more than a day without any issues. To me this looks and feels good so far. |
@JeffryBooher @btjones @njx I feel good about these changes. I've used this shell now for more than a week and I haven't noticed any regression. I'm fine with merging the PR. Please speak up now or I'm going to merge it around noon PST. |
@JeffryBooher @bchintx Is there a similar static analyzer we could run on Windows? There were enough little leaks found here that it seems highly likely some similar problems exist on Windows too... |
On the Mac, Xcode uses Clang Static Analyzer: http://clang-analyzer.llvm.org/ To use it on Windows you will need to build it from source (http://clang-analyzer.llvm.org/installation#OtherPlatforms). I'm guessing there may be something more standard on the Windows side though. |
You can also use the static analysis built in to Visual Studio. There is also Coverity which Adobe has a license for. |
@ingorichter I tested this around the areas I was concerned with and it looks good. I think it's ready to merge. |
@JeffryBooher @peterflynn Do we want to create a story for Windows to track efforts on static code analysis? |
Thank you @btjones. |
resolve (most) mac static analyzer issues
@ingorichter I think we should, yeah. Or a general 'memory leak audit' card at least (whether it's static analysis or valgrind or what). |
We could make static analysis part of the daily build. |
Yes, we could have a separate job to run the analysis more frequently. What tools would we use for Windows? |
resolve (most) mac static analyzer issues
This resolves most of the potential (and actual) memory leaks and other issues identified by the Xcode static analyzer. The only analyzer issues that I did not resolve are:
The reason I didn't make any changes here are because it appears brackets-shell is overriding a cef window delegate, as explained in the comment at client_handler_mac.mm:411, and the code is decrementing the cef delegate which we don't have ownership of BUT it is intentional. I left that code as-is for now because I did not see a simple way to resolve those two analyzer issues.
After running Instruments and looking for leaks, this update fixes quite a few leaks which were appearing when opening the app.
All Brackets Jasmine tests pass.