Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d74a09

Browse filesBrowse files
committed
2 parents 6afe081 + d1951c1 commit 0d74a09
Copy full SHA for 0d74a09

File tree

2 files changed

+7
-5
lines changed
Filter options

2 files changed

+7
-5
lines changed

‎Demos/Demo36/ParallelPython.dpr

Copy file name to clipboardExpand all lines: Demos/Demo36/ParallelPython.dpr
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ begin
109109
WriteLn('Elapsed ms: ' + SW.ElapsedMilliseconds.ToString);
110110
WriteLn;
111111
finally
112+
Sleep(1000); // allow some time for the threads to terminate
112113
DestroyEngine;
113114
end;
114115
except

‎Source/WrapDelphi.pas

Copy file name to clipboardExpand all lines: Source/WrapDelphi.pas
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,25 +616,26 @@ TPyDelphiObjectClass = class of TPyDelphiObject;
616616
Generic wrapper for pascal classes
617617
618618
Can be used from unit wrappers as follows:
619-
APyDelphiWrapper.RegisterDelphiWrapper(TPyClassWrapper<TMyClass>);
619+
PyDelphiWrapper1.RegisterDelphiWrapper(TPyClassWrapper<TMyClass>);
620620
or at runtime (e.g. inside the FormCreate handler:
621621
PyDelphiWrapper1.RegisterDelphiWrapper(TPyClassWrapper<TMyClass>).Initialize;
622622
623623
if you want your class to capable of being instantiated from python then do:
624624
625-
TTestWrapper = class(TPyClassWrapper<TTest>)
625+
TMyClassWrapper = class(TPyClassWrapper<TMyClass>)
626626
constructor CreateWith(APythonType: TPythonType; args, kwds: PPyObject); overload; override;
627627
end;
628628
629-
constuctor TTestWrapper.CreateWith(APythonType: TPythonType; args, kwds: PPyObject);
629+
constuctor TMyClassWrapper.CreateWith(APythonType: TPythonType; args, kwds: PPyObject);
630630
begin
631631
Create(APythonType);
632-
DelphiObject := TTest.Create;
632+
DelphiObject := TMyClass.Create;
633633
end;
634634
635-
PyDelphiWrapper1.RegisterDelphiWrapper(TTestWrapper).Initialize;
635+
PyDelphiWrapper1.RegisterDelphiWrapper(TMyClassWrapper).Initialize;
636636
}
637637
TPyClassWrapper<T: class> = class(TPyDelphiObject)
638+
private
638639
function GetDelphiObject: T;
639640
procedure SetDelphiObject(const Value: T);
640641
public

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.