objective c - How can this Xcode Clang static analyzer warning be suppressed? -
"potential leak of object allocated on line n , stored 'variable'."
normally helpful analyzer warning, there few situations annoying false positives suppress keep analyzer results clean. in analyzer's defense, it's noticing memory leak not release in path of execution (to blind).
i'll elaborate on situation. happens in various flavors, general pattern follows:
- an object allocated , delegate set.
- something done object. (a task started, view displayed, etc).
- execution of current method ends. (enter clang warning).
- object decides task complete, sends delegate message.
- delegate releases object.
this not @ esoteric design pattern, i'm hoping suppression possible. know can avoided storing offending object in ivar later released, prefer not add ivar pollution.
clang has few new source annotations. in specific, may interested in ns_consumed attribute.
Comments
Post a Comment