Fix potential retain loop via document SCM callback

If we closed a window with a document SCM callback for the current document, but that document was untitled (so it wouldn’t be cleared during shutdown), we would keep ‘self’ retained.
This commit is contained in:
Allan Odgaard
2013-02-22 17:59:42 +01:00
parent e033b7031f
commit ca0c72e0c0

View File

@@ -1113,7 +1113,7 @@ namespace
{
__weak DocumentController* weakSelf = self;
_documentSCMInfo->add_callback(^(scm::info_t const& info){
weakSelf.documentSCMStatus = info.status(to_s(self.documentPath));
weakSelf.documentSCMStatus = info.status(to_s(weakSelf.documentPath));
weakSelf.documentSCMVariables = info.variables();
});
}