File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -875,7 +875,8 @@ TPyDelphiWrapper = class(TEngineClient, IFreeNotificationSubscriber)
875875 out AValue : TObject) : Boolean;
876876 function CheckCallableAttribute (AAttribute : PPyObject; const AAttributeName : string) : Boolean;
877877 function CheckEnum (const AEnumName : string; AValue, AMinValue, AMaxValue : Integer) : Boolean;
878- function CreateVarParam (PyDelphiWrapper : TPyDelphiWrapper; const AValue : Variant) : PPyObject;
878+ function CreateVarParam (PyDelphiWrapper : TPyDelphiWrapper; const AValue : Variant) : PPyObject; overload;
879+ function CreateVarParam (PyDelphiWrapper : TPyDelphiWrapper; AObject: TObject) : PPyObject; overload;
879880 function SetToPython (ATypeInfo: PTypeInfo; AValue : Integer) : PPyObject; overload;
880881 function SetToPython (APropInfo: PPropInfo; AValue : Integer) : PPyObject; overload;
881882 function SetToPython (AInstance: TObject; APropInfo: PPropInfo) : PPyObject; overload;
@@ -1304,6 +1305,16 @@ function CreateVarParam(PyDelphiWrapper : TPyDelphiWrapper; const AValue : Varia
13041305 GetPythonEngine.Py_DECREF(tmp);
13051306end ;
13061307
1308+ function CreateVarParam (PyDelphiWrapper : TPyDelphiWrapper; AObject: TObject) : PPyObject;
1309+ var
1310+ tmp: PPyObject;
1311+ begin
1312+ Result := PyDelphiWrapper.VarParamType.CreateInstance;
1313+ tmp := PyDelphiWrapper.Wrap(AObject);
1314+ (PythonToDelphi(Result) as TPyDelphiVarParameter).Value := tmp;
1315+ GetPythonEngine.Py_DECREF(tmp);
1316+ end ;
1317+
13071318function SupportsFreeNotification (AObject : TObject) : Boolean;
13081319var
13091320 _FreeNotification : IFreeNotification;
You can’t perform that action at this time.
0 commit comments