[SR-1339] switch
statement memory leak (again)
#43947
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
memory leak
bug: Memory leak
Attachment: Download
Environment
MacBook Pro (Retina, 15-inch, Late 2013),
2 GHz Intel Core i7,
8 GB 1600 MHz DDR3,
Xcode 7.3
Additional Detail from JIRA
md5: 7e9b79a33bb9f7fde7e2605312aa8d54
Issue Description:
There was a bug fixed with the release of Xcode 7.1:
I have found that this bug still persists in Xcode 7.3, however this time it is occurring in switch statements with pattern matching regarding enums with associated values. Since switch statements are the only method of accessing associated values inside enum cases there is no good rewrite with if statements. The problem exists only when there are more 5 or 6 cases in the switch statement with each case using pattern matching to capture the associated value.
For the time being I have resolved the memory leak by having smaller switch statements in separate funcs that take in parameters by reference (inout). This does solve the memory leak. However this isn't a clean solution and it feels to me very much like the bug found in previous versions of Xcode using as pattern matching.
Thank you
The text was updated successfully, but these errors were encountered: