mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Only remove buffer callback if added
This is incase our initializer fails, here dealloc is still called, but we didn’t get to add the callback so we should not try to remove it. Why our initializer would fail is beyond me, but I see a few crashes from this (though all from the same user on 10.8.5).
This commit is contained in:
@@ -94,7 +94,8 @@ static int32_t const NSWrapColumnWindowWidth = 0;
|
||||
[_document endUndoGrouping];
|
||||
|
||||
[self documentWillSave:_document];
|
||||
self.buffer.remove_callback(_buffer_callback.get());
|
||||
if(_document && _buffer_callback)
|
||||
self.buffer.remove_callback(_buffer_callback.get());
|
||||
_layout.reset();
|
||||
_editor.reset();
|
||||
[_document close];
|
||||
|
||||
Reference in New Issue
Block a user