Skip to content

Commit

Permalink
[WinForms] fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
jwosty committed Dec 18, 2020
1 parent 93ada74 commit 708a45c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Interstellar.WindowsCommon.Chromium/Platform.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ open CefSharp.WinForms
type Platform private() =
static let mutable isInitialized = false
static let initLock = new Object()

static member Initialize () =
lock initLock (fun () ->
if not isInitialized then
AppDomain.CurrentDomain.add_AssemblyResolve (ResolveEventHandler(Platform.ResolveCefSharpAssembly))
Platform.InitAnyCpuCefSharp () |> ignore
)

// Without this inlining, WinForms builds crash in Release mode: https://github.com/jwosty/Interstellar/issues/10
[<System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)>]
static member Shutdown () =
Cef.Shutdown ()

Expand Down

0 comments on commit 708a45c

Please sign in to comment.