From 5ee70bfe29f6bbfd70300035c845edefc4cc2fdb Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Sat, 24 Sep 2016 09:06:14 +0200 Subject: [PATCH] Use instance variable for documents array instead --- .../DocumentWindow/src/DocumentWindowController.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Frameworks/DocumentWindow/src/DocumentWindowController.mm b/Frameworks/DocumentWindow/src/DocumentWindowController.mm index 993897d7..cd7c862b 100644 --- a/Frameworks/DocumentWindow/src/DocumentWindowController.mm +++ b/Frameworks/DocumentWindow/src/DocumentWindowController.mm @@ -86,6 +86,7 @@ static void show_command_error (std::string const& message, oak::uuid_t const& u NSMutableDictionary* _trackedDocuments; NSMutableSet* _stickyDocumentIdentifiers; + NSArray* _documents; scm::info_ptr _projectSCMInfo; std::map _projectSCMVariables; @@ -1640,10 +1641,7 @@ namespace - (NSArray*)documents { - NSMutableArray* res = [NSMutableArray array]; - for(auto doc : _cppDocuments) - [res addObject:doc->document()]; - return res; + return _documents; } - (void)setCppDocuments:(std::vector)newDocuments @@ -1662,6 +1660,11 @@ namespace _cppDocuments = newDocuments; + NSMutableArray* docs = [NSMutableArray array]; + for(auto doc : _cppDocuments) + [docs addObject:doc->document()]; + _documents = docs; + if(_cppDocuments.size()) [self.tabBarView reloadData];