Browse Source

Unbind in channelframe.

pull/175/head
Greg Holmes 9 years ago
parent
commit
85f2daf073

+ 6
- 3
ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/ChannelFrame.java View File

@@ -35,6 +35,7 @@ import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputField;
35 35
 import com.dmdirc.addons.ui_swing.dialogs.channelsetting.ChannelSettingsDialog;
36 36
 import com.dmdirc.addons.ui_swing.injection.KeyedDialogProvider;
37 37
 import com.dmdirc.commandparser.PopupType;
38
+import com.dmdirc.config.ConfigBinder;
38 39
 import com.dmdirc.config.ConfigBinding;
39 40
 import com.dmdirc.events.ClientClosingEvent;
40 41
 import com.dmdirc.events.FrameClosingEvent;
@@ -84,6 +85,8 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
84 85
     private final KeyedDialogProvider<Channel, ChannelSettingsDialog> dialogProvider;
85 86
     /** Channel instance. */
86 87
     private final Channel channel;
88
+    /** Config binder. */
89
+    private final ConfigBinder binder;
87 90
 
88 91
     /**
89 92
      * Creates a new instance of ChannelFrame. Sets up callbacks and handlers, and default options
@@ -114,6 +117,8 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
114 117
         this.channel = owner;
115 118
 
116 119
         initComponents(topicBarFactory, deps.colourManagerFactory);
120
+        binder = getContainer().getConfigManager().getBinder().withDefaultDomain(domain);
121
+        binder.bind(this, ChannelFrame.class);
117 122
 
118 123
         eventBus.subscribe(this);
119 124
 
@@ -146,8 +151,6 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
146 151
         add(getSearchBar(), "growx");
147 152
         add(inputPanel, "growx");
148 153
 
149
-        getContainer().getConfigManager()
150
-                .getBinder().withDefaultDomain(domain).bind(this, ChannelFrame.class);
151 154
         splitPane.setLeftComponent(getTextPane());
152 155
         splitPane.setResizeWeight(1);
153 156
         splitPane.setDividerLocation(-1);
@@ -237,7 +240,7 @@ public final class ChannelFrame extends InputTextFrame implements ActionListener
237 240
     @Override
238 241
     public void dispose() {
239 242
         eventBus.unsubscribe(this);
240
-        globalConfig.removeListener(this);
243
+        binder.unbind(this);
241 244
         super.dispose();
242 245
     }
243 246
 

Loading…
Cancel
Save