1515// You should have received a copy of the GNU General Public License
1616// along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
18- using Microsoft . Win32 ;
1918using QuickLook . Common . Helpers ;
2019using QuickLook . Helpers ;
2120using QuickLook . NativeMethods ;
@@ -228,8 +227,6 @@ protected override void OnStartup(StartupEventArgs e)
228227
229228 // Set initial theme based on system settings
230229 ThemeManager . Apply ( OSThemeHelper . AppsUseDarkTheme ( ) ? ApplicationTheme . Dark : ApplicationTheme . Light ) ;
231- UxTheme . ApplyPreferredAppMode ( isTracked : true ) ;
232- SystemEvents . SessionEnding += OnSessionEnding ;
233230
234231 // Initialize MessageBox patching
235232 MessageBoxPatcher . Initialize ( ) ;
@@ -239,21 +236,8 @@ protected override void OnStartup(StartupEventArgs e)
239236 CheckAndRegisterPluginIcon ( ) ;
240237 }
241238
242- protected virtual void OnSessionEnding ( object sender , SessionEndingEventArgs e )
243- {
244- SystemEvents . SessionEnding -= OnSessionEnding ;
245-
246- // You must unsubscribe from SystemEvents events before your application exits, or the application may crash
247- // https://github.com/QL-Win/QuickLook/issues/1782
248- UxTheme . ApplyPreferredAppMode ( isTracked : false ) ;
249- }
250-
251239 protected override void OnExit ( ExitEventArgs e )
252240 {
253- // You must unsubscribe from SystemEvents events before your application exits, or the application may crash
254- // https://github.com/QL-Win/QuickLook/issues/1782
255- UxTheme . ApplyPreferredAppMode ( isTracked : false ) ;
256-
257241 base . OnExit ( e ) ;
258242
259243 if ( ! _cleanExit )
0 commit comments