mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Fix SCM callback crash
Since we retained the SCM info in an asynchronous block, we would potentially extend the lifetime of the SCM info and thus the associated callback, so the callback could be invoked after its owner had been disposed.
This commit is contained in:
@@ -165,7 +165,7 @@ private:
|
||||
add_item_and_children(child, array);
|
||||
}
|
||||
|
||||
static void async_reload (FSDirectoryDataSource* dataSource, FSItem* rootItem, scm::ng::info_ptr scmInfo, bool reloadWasRequested)
|
||||
static void async_reload (FSDirectoryDataSource* dataSource, FSItem* rootItem, scm::ng::weak_info_ptr weakSCMInfo, bool reloadWasRequested)
|
||||
{
|
||||
std::string const dir = to_s([rootItem.url path]);
|
||||
bool includeHidden = (dataSource.dataSourceOptions & kFSDataSourceOptionIncludeHidden) == kFSDataSourceOptionIncludeHidden;
|
||||
@@ -209,6 +209,7 @@ private:
|
||||
existingItems.insert(std::make_pair(std::make_pair(item.device, item.inode), item));
|
||||
|
||||
std::set<std::string> pathsOnDisk;
|
||||
scm::ng::info_ptr scmInfo = weakSCMInfo.lock();
|
||||
|
||||
NSMutableArray* array = [NSMutableArray array];
|
||||
for(auto const& fsItem : newItems)
|
||||
|
||||
Reference in New Issue
Block a user