mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-02-02 10:25:26 +02:00
Workaround for issue #416
Possible fix for issue #416 : JSRTTIExtension and CustomTitleBar demos crash in CEF 101
This commit is contained in:
parent
2def5dd432
commit
959d152d9c
@ -87,6 +87,7 @@ type
|
||||
class function StrToPtr(const str: ustring): Pointer;
|
||||
class function PtrToStr(p: Pointer): ustring;
|
||||
{$ENDIF}
|
||||
function HandleProperties(const name: ustring; const arguments: TCefv8ValueArray; var retval: ICefv8Value): boolean;
|
||||
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
||||
|
||||
public
|
||||
@ -805,6 +806,19 @@ begin
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function TCefRTTIExtension.HandleProperties(const name : ustring;
|
||||
const arguments : TCefv8ValueArray;
|
||||
var retval : ICefv8Value): boolean;
|
||||
begin
|
||||
Result := True;
|
||||
if name = '$g' then
|
||||
SetValue(FValue, retval)
|
||||
else if name = '$s' then
|
||||
GetValue(FValue.TypeInfo, arguments[0], FValue)
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function TCefRTTIExtension.Execute(const name : ustring;
|
||||
const object_ : ICefv8Value;
|
||||
const arguments : TCefv8ValueArray;
|
||||
@ -825,9 +839,12 @@ var
|
||||
ret: TValue;
|
||||
begin
|
||||
Result := True;
|
||||
if HandleProperties(name, arguments, retval) then
|
||||
exit;
|
||||
|
||||
p := PChar(name);
|
||||
m := nil;
|
||||
if object_ <> nil then
|
||||
if assigned(object_) and object_.IsValid then
|
||||
begin
|
||||
ud := object_.GetUserData;
|
||||
if ud <> nil then
|
||||
@ -970,16 +987,6 @@ begin
|
||||
Exit(False);
|
||||
end else
|
||||
Exit(False);
|
||||
end else
|
||||
if p^ = '$' then
|
||||
begin
|
||||
inc(p);
|
||||
case p^ of
|
||||
'g': SetValue(FValue, retval);
|
||||
's': GetValue(FValue.TypeInfo, arguments[0], FValue);
|
||||
else
|
||||
Exit(False);
|
||||
end;
|
||||
end else
|
||||
Exit(False);
|
||||
end else
|
||||
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 394,
|
||||
"InternalVersion" : 395,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "101.0.18.0"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user