Skip to content

Commit f218b64

Browse files
committed
Fuck NSBundle
1 parent 12a5a1d commit f218b64

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎Classes/Controllers/TXMasterController.m‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ - (void)applicationWillTerminate:(NSNotification *)note
331331
#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
332332
[sharedCloudManager() closeCloudSyncSession];
333333
#endif
334-
335-
[RZUserDefaults() synchronize];
336334
}
337335

338336
- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag

‎Classes/Headers/THOPluginItem.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252
- (void)loadBundle:(NSBundle *)bundle;
5353

54+
- (void)sendDealloc;
55+
5456
- (NSView *)pluginPreferenesPaneView;
5557
- (NSString *)pluginPreferencesPaneMenuItemName;
5658
@end

‎Classes/Helpers/Plugin Architecture/THOPluginItem.m‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ - (void)loadBundle:(NSBundle *)bundle
220220
}
221221
}
222222

223-
- (void)dealloc
223+
- (void)sendDealloc
224224
{
225225
BOOL supportsOldFeature = [self.primaryClass respondsToSelector:@selector(pluginUnloadedFromMemory)];
226226
BOOL supportsNewFeature = [self.primaryClass respondsToSelector:@selector(pluginWillBeUnloadedFromMemory)];

‎Classes/Helpers/Plugin Architecture/THOPluginManager.m‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,11 @@ - (void)loadPlugins
138138
- (void)unloadPlugins
139139
{
140140
TXPerformBlockSynchronouslyOnQueue(self.dispatchQueue, ^{
141-
self.allLoadedPlugins = nil;
142-
143-
for (NSBundle *bundle in self.allLoadedBundles) {
144-
if ([bundle isLoaded]) {
145-
[bundle unload];
146-
}
141+
for (THOPluginItem *plugin in self.allLoadedPlugins) {
142+
[plugin sendDealloc];
147143
}
148144

145+
self.allLoadedPlugins = nil;
149146
self.allLoadedBundles = nil;
150147
});
151148
}

0 commit comments

Comments
 (0)