Skip to content

Commit 0d74a09

Browse files
committed
2 parents 6afe081 + d1951c1 commit 0d74a09

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Demos/Demo36/ParallelPython.dpr

Lines 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

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy