Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crash on macOS after closing the Py-QT5 window. #409

Open
HawaiAl opened this issue Feb 3, 2023 · 4 comments
Open

Application crash on macOS after closing the Py-QT5 window. #409

HawaiAl opened this issue Feb 3, 2023 · 4 comments

Comments

@HawaiAl
Copy link

HawaiAl commented Feb 3, 2023

Hello.
There is a big problem with macOS Ventura 13.1.
I've made the simplest app for macOS 64-bit - one Form, one Button. It executes a very simple python script.

Everything works fine, but after closing the chart window, the application crashes with a message in a PAServer:
objc_disposeClassPair: class 'FMXWindow' still has subclasses, including 'NSKVONotifying_FMXWindow’!

In larger projects, the effect is stranger. What can be done to solve this problem?

P.S. It is also interesting that after running the script, the application icon changes to the Matplotlib icon.

unit MainUnit;
interface
uses
   PythonEngine,
   System.Classes,
   FMX.Forms, FMX.Controls, FMX.Controls.Presentation, FMX.StdCtrls, FMX.Types;

type
   TFormMain = class(TForm)
      ButtonRun: TButton;
      procedure FormCreate(Sender: TObject);
      procedure ButtonRunClick(Sender: TObject);
      private
         py: TPythonEngine;
   end;

var
   FormMain: TFormMain;

implementation
{$R *.fmx}

procedure TFormMain.FormCreate(Sender: TObject);
begin
   // Create python engine
   py                     := TPythonEngine.Create(Self);
   py.UseLastKnownVersion := True;
   py.FatalAbort          := False;
   py.FatalMsgDlg         := False;
   // Load DLL
   py.LoadDll;
end;

procedure TFormMain.ButtonRunClick(Sender: TObject);
begin
   // Simple script, that uses matplotlib and Py-QT5
   var s: ANSIString := 'import matplotlib.pyplot as plt'#10
         + 'plt.plot([1.6, 2.7])'#10
         + 'plt.show()';
   py.ExecString(s);
end;

end.
@pyscripter
Copy link
Owner

@lmbelo Any idea what this error message means?

@lmbelo
Copy link
Contributor

lmbelo commented Feb 27, 2023

I will try to reproduce it here and reply with further details.

@pyscripter
Copy link
Owner

@lmbelo Any progress on this one?

@lmbelo
Copy link
Contributor

lmbelo commented Aug 2, 2023

@pyscripter I still didn't investigate this case. Checking it as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants