Browse Source

Don't update server titles when closing

Should fix issue 3312

Change-Id: Ie6b62188e59c7ac20929e0ce791079cec425fe58
Reviewed-on: http://gerrit.dmdirc.com/222
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
Tested-by: Gregory Holmes <greboid@dmdirc.com>
tags/0.6.3b1
Chris Smith 14 years ago
parent
commit
b70b0198e3
1 changed files with 17 additions and 11 deletions
  1. 17
    11
      src/com/dmdirc/Server.java

+ 17
- 11
src/com/dmdirc/Server.java View File

@@ -1175,17 +1175,23 @@ public class Server extends WritableFrameContainer implements
1175 1175
      * Updates the name and title of this window.
1176 1176
      */
1177 1177
     public void updateTitle() {
1178
-        synchronized (parserLock) {
1179
-            final Object[] arguments = new Object[]{
1180
-                address.getHost(), parser == null ? "Unknown" : parser.getServerName(),
1181
-                address.getPort(), parser == null ? "Unknown" : getNetwork(),
1182
-                parser == null ? "Unknown" : parser.getLocalClient().getNickname()
1183
-            };
1184
-        
1185
-            setName(Formatter.formatMessage(getConfigManager(),
1186
-                    "serverName", arguments));
1187
-            window.setTitle(Formatter.formatMessage(getConfigManager(),
1188
-                    "serverTitle", arguments));
1178
+        synchronized (myStateLock) {
1179
+            if (myState.getState() == ServerState.CLOSING) {
1180
+                return;
1181
+            }
1182
+
1183
+            synchronized (parserLock) {
1184
+                final Object[] arguments = new Object[]{
1185
+                    address.getHost(), parser == null ? "Unknown" : parser.getServerName(),
1186
+                    address.getPort(), parser == null ? "Unknown" : getNetwork(),
1187
+                    parser == null ? "Unknown" : parser.getLocalClient().getNickname()
1188
+                };
1189
+
1190
+                setName(Formatter.formatMessage(getConfigManager(),
1191
+                        "serverName", arguments));
1192
+                window.setTitle(Formatter.formatMessage(getConfigManager(),
1193
+                        "serverTitle", arguments));
1194
+            }
1189 1195
         }
1190 1196
     }
1191 1197
 

Loading…
Cancel
Save