Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fuck NSBundle
  • Loading branch information
emsquared committed Jul 8, 2014
1 parent 12a5a1d commit f218b64
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions Classes/Controllers/TXMasterController.m
Expand Up @@ -331,8 +331,6 @@ - (void)applicationWillTerminate:(NSNotification *)note
#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
[sharedCloudManager() closeCloudSyncSession];
#endif

[RZUserDefaults() synchronize];
}

- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag
Expand Down
2 changes: 2 additions & 0 deletions Classes/Headers/THOPluginItem.h
Expand Up @@ -51,6 +51,8 @@

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

- (void)sendDealloc;

- (NSView *)pluginPreferenesPaneView;
- (NSString *)pluginPreferencesPaneMenuItemName;
@end
2 changes: 1 addition & 1 deletion Classes/Helpers/Plugin Architecture/THOPluginItem.m
Expand Up @@ -220,7 +220,7 @@ - (void)loadBundle:(NSBundle *)bundle
}
}

- (void)dealloc
- (void)sendDealloc
{
BOOL supportsOldFeature = [self.primaryClass respondsToSelector:@selector(pluginUnloadedFromMemory)];
BOOL supportsNewFeature = [self.primaryClass respondsToSelector:@selector(pluginWillBeUnloadedFromMemory)];
Expand Down
9 changes: 3 additions & 6 deletions Classes/Helpers/Plugin Architecture/THOPluginManager.m
Expand Up @@ -138,14 +138,11 @@ - (void)loadPlugins
- (void)unloadPlugins
{
TXPerformBlockSynchronouslyOnQueue(self.dispatchQueue, ^{
self.allLoadedPlugins = nil;

for (NSBundle *bundle in self.allLoadedBundles) {
if ([bundle isLoaded]) {
[bundle unload];
}
for (THOPluginItem *plugin in self.allLoadedPlugins) {
[plugin sendDealloc];
}

self.allLoadedPlugins = nil;
self.allLoadedBundles = nil;
});
}
Expand Down

0 comments on commit f218b64

Please sign in to comment.