From b9b25a9af132cbe1193f42c2bdd9c3dee684dbc1 Mon Sep 17 00:00:00 2001 From: Andreas Hausladen Date: Sat, 9 Nov 2019 12:42:40 +0100 Subject: [PATCH] Fix "Invalid COM thread model change" with Debug-DLLs for FMX --- source/uCEFApplication.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/uCEFApplication.pas b/source/uCEFApplication.pas index 680f0122..c6c4948a 100644 --- a/source/uCEFApplication.pas +++ b/source/uCEFApplication.pas @@ -51,7 +51,7 @@ interface uses {$IFDEF DELPHI16_UP} {$IFDEF MSWINDOWS} - WinApi.Windows, {$IFNDEF FMX}Vcl.Forms, WinApi.ActiveX,{$ENDIF} + WinApi.Windows, WinApi.ActiveX, {$IFNDEF FMX}Vcl.Forms,{$ENDIF} {$ENDIF} System.Classes, System.UITypes, {$ELSE} @@ -847,6 +847,15 @@ begin end; end; end; + {$ELSE} // FMX + {$IFDEF MSWINDOWS} + if ProcessType <> ptBrowser then + begin + // Undo the OleInitialize from FMX.Platform.Win::initialization. The sub-processes want a different + // COM thread model and fail with an assertion if the Debug-DLLs are used. + OleUninitialize; + end; + {$ENDIF MSWINDOWS} {$ENDIF} {$ENDIF}