Skip to content

Commit c35e2e5

Browse files
committed
minor tweaks
1 parent 6d60e07 commit c35e2e5

3 files changed

Lines changed: 21 additions & 18 deletions

File tree

FlashpointSecurePlayer/ActiveXControl.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@ public ActiveXControl(string libFileName) {
4343
}
4444

4545
~ActiveXControl() {
46-
if (moduleHandle != IntPtr.Zero) {
47-
try {
48-
if (!FreeLibrary(moduleHandle)) {
49-
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
50-
return;
51-
}
52-
} catch (Exception ex) {
53-
LogExceptionToLauncher(ex);
46+
if (moduleHandle == IntPtr.Zero) {
47+
return;
48+
}
49+
50+
try {
51+
if (!FreeLibrary(moduleHandle)) {
52+
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
53+
return;
5454
}
55+
} catch (Exception ex) {
56+
LogExceptionToLauncher(ex);
5557
}
5658
}
5759

FlashpointSecurePlayer/Shared.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,15 +2193,17 @@ public static StringBuilder GetWindowsVersionName(bool edition = false, bool ser
21932193
*/
21942194

21952195
public static void HandleAntecedentTask(Task antecedentTask) {
2196-
if (antecedentTask.IsFaulted) {
2197-
Exception ex = antecedentTask.Exception;
2196+
if (!antecedentTask.IsFaulted) {
2197+
return;
2198+
}
21982199

2199-
while (ex is AggregateException && ex.InnerException != null) {
2200-
ex = ex.InnerException;
2201-
}
2200+
Exception ex = antecedentTask.Exception;
22022201

2203-
throw ex;
2202+
while (ex is AggregateException && ex.InnerException != null) {
2203+
ex = ex.InnerException;
22042204
}
2205+
2206+
throw ex;
22052207
}
22062208

22072209
public static async Task<Uri> DownloadAsync(string name) {
@@ -2376,8 +2378,8 @@ private static Configuration GetEXEConfiguration(bool create, string name) {
23762378
Exceptions.LogExceptionToLauncher(ex2);
23772379
throw new ConfigurationErrorsException("The EXE Configuration is in use.");
23782380
}
2379-
} catch (IOException ex2) {
2380-
Exceptions.LogExceptionToLauncher(ex2);
2381+
} catch (IOException ex) {
2382+
Exceptions.LogExceptionToLauncher(ex);
23812383
throw new ConfigurationErrorsException("The EXE Configuration is in use.");
23822384
}
23832385

FlashpointSecurePlayer/WebBrowserMode.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public partial class WebBrowserMode : Form {
2222
private IntPtr mouseHook = IntPtr.Zero;
2323

2424
private IntPtr LowLevelMouseProc(int nCode, IntPtr wParam, IntPtr lParam) {
25-
// we don't want errors to prevent passing the window message
2625
try {
2726
if (nCode >= 0) {
2827
// always confirm the message first so we don't do unnecessary work
@@ -52,7 +51,7 @@ private IntPtr LowLevelMouseProc(int nCode, IntPtr wParam, IntPtr lParam) {
5251
}
5352
}
5453
} catch {
55-
// fail silently
54+
// we don't want exceptions to prevent passing the window message
5655
}
5756
return CallNextHookEx(mouseHook, nCode, wParam, lParam);
5857
}

0 commit comments

Comments
 (0)