Invalidate backup timer when removing backup

The backup timer is retaining our document so the document would live for up to two seconds after it was closed, this was mainly a problem for untitled documents, as it meant the next new untitled document created would get a display name of “untitled n”.
This commit is contained in:
Allan Odgaard
2016-09-16 15:25:47 +02:00
parent d8a18057fa
commit 084ec6ac8f

View File

@@ -551,6 +551,9 @@ NSString* OakDocumentBookmarkIdentifier = @"bookmark";
- (void)removeBackup
{
[_backupTimer invalidate];
_backupTimer = nil;
if(_backupPath)
{
[[NSFileManager defaultManager] removeItemAtPath:_backupPath error:nullptr];