@@ -1034,14 +1034,14 @@ private void InitializeComponents()
1034
1034
this . Font = this . appSettings . DefaultFont ;
1035
1035
this . StartPosition = FormStartPosition . Manual ;
1036
1036
this . Closing += new CancelEventHandler ( this . OnMainFormClosing ) ;
1037
+ this . FormClosed += new FormClosedEventHandler ( this . OnMainFormClosed ) ;
1037
1038
this . Activated += new EventHandler ( this . OnMainFormActivate ) ;
1038
1039
this . Shown += new EventHandler ( this . OnMainFormShow ) ;
1039
1040
this . Load += new EventHandler ( this . OnMainFormLoad ) ;
1040
1041
this . LocationChanged += new EventHandler ( this . OnMainFormLocationChange ) ;
1041
1042
this . GotFocus += new EventHandler ( this . OnMainFormGotFocus ) ;
1042
1043
this . Resize += new EventHandler ( this . OnMainFormResize ) ;
1043
-
1044
- ScintillaManager . ConfigurationLoaded += ApplyAllSettings ;
1044
+ ScintillaManager . ConfigurationLoaded += this . ApplyAllSettings ;
1045
1045
}
1046
1046
1047
1047
#endregion
@@ -1216,16 +1216,23 @@ public void OnMainFormClosing(Object sender, System.ComponentModel.CancelEventAr
1216
1216
PluginServices . DisposePlugins ( ) ;
1217
1217
this . KillProcess ( ) ;
1218
1218
this . SaveAllSettings ( ) ;
1219
- /* Restart if requested */
1220
- if ( this . restartRequested )
1221
- {
1222
- this . restartRequested = false ;
1223
- Application . Restart ( ) ;
1224
- }
1225
1219
}
1226
1220
else this . restartRequested = false ;
1227
1221
}
1228
1222
1223
+ /// <summary>
1224
+ /// When form is closed restart if requested.
1225
+ /// </summary>
1226
+ public void OnMainFormClosed ( Object sender , FormClosedEventArgs e )
1227
+ {
1228
+ if ( this . restartRequested )
1229
+ {
1230
+ this . restartRequested = false ;
1231
+ Process . Start ( Application . ExecutablePath ) ;
1232
+ Process . GetCurrentProcess ( ) . Kill ( ) ;
1233
+ }
1234
+ }
1235
+
1229
1236
/// <summary>
1230
1237
/// When dock changes, applies the padding to documents
1231
1238
/// </summary>
0 commit comments