mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Only remove the view from the set of views that are being Mirror-drawn when you're actually done reflecting on it
The previous code would always remove the view on exit, even if it had not previously added it (default: case of the switch) In simple cases, this didn't really matter, but if you caused the logger to be reinvoked on self in a loop, then you would end up removing the view before you were done looping over it, and eventually run out of stack space Fixes rdar://19558026 Swift SVN r24737
This commit is contained in:
@@ -107,11 +107,11 @@ struct _NSViewMirror : MirrorType {
|
||||
_v.cacheDisplayInRect(bounds, toBitmapImageRep: b)
|
||||
result = .Some(.View(b))
|
||||
}
|
||||
|
||||
_NSViewMirror._views.removeObject(_v)
|
||||
default: ()
|
||||
}
|
||||
|
||||
_NSViewMirror._views.removeObject(_v)
|
||||
|
||||
return result
|
||||
|
||||
} }
|
||||
|
||||
Reference in New Issue
Block a user