Navid Madani 1 Posted February 11 I have encountered a strange problem: Delphi Athens is running via Parallels on Apple Silicone. In the following demo, none of the destroyers are called when targeting macOS ARM 64, while everything works OK targeting Windows). Also, I can get the Windows target to report the memory leak when I comment out fDebug.Free in FormDestroy, but not with macOS ARM 64. Can anyone else reproduce this? Am I missing something? Thanks! unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs; type TForm1 = class(TForm) procedure FormDestroy(Sender: TObject); procedure FormCreate(Sender: TObject); private fDebug: TObject; public destructor Destroy; override; end; var Form1: TForm1; implementation {$R *.fmx} // TForm1.FormDestroy is not called when Target is macOS ARM 64-bit procedure TForm1.FormDestroy(Sender: TObject); begin ShowMessage('FormDestroy Called'); fDebug.Free; end; // TForm1.Destroy is not called when Target is macOS ARM 64-bit destructor TForm1.Destroy; begin ShowMessage('Destroy Called'); inherited; end; procedure TForm1.FormCreate(Sender: TObject); begin fDebug := TObject.Create; end; end. Share this post Link to post
Patrick PREMARTIN 74 Posted February 11 It's not new : destroy of the main form and finalization bloc in units is not executed on Mac since years. On Mac, for the main form use the onClose event instead of onDestroy. Share this post Link to post
uligerhardt 18 Posted February 12 16 hours ago, Patrick PREMARTIN said: It's not new : destroy of the main form and finalization bloc in units is not executed on Mac since years. On Mac, for the main form use the onClose event instead of onDestroy. Is this the cross-platform development I keep reading about? 😎 Share this post Link to post
LGROX 0 Posted February 12 I also stumbled upon this bug in one of my multi device apps when I tried to save data to a file within an OnDestroy event in a data module. Nothing was saved! The same problem in both macOS for Intel and macOS for ARM. In reality, it’s even more serious. Neither OnDestroy nor destructors in forms or data modules are called when Mac apps are shut down! As a workaround, as mentioned earlier, you can place shutdown code in the main forms’ OnClose events. However, OnClose doesn’t exist in data modules, so in this case, the shutdown code must be called from the main form. The problem is reported in RSP-26436, but only that the main form’s OnDestroy is not called. However, the issue is indeed worse. Unfortunately, QualityPortal is currently closed for new comments, but voting is still possible, so please vote to address this critical bug! 🙏 Share this post Link to post
Cristian Peța 103 Posted February 12 32 minutes ago, LGROX said: The problem is reported in RSP-26436 You have not posted a link and probably it's a stupid question but how to find a RSP by number? Share this post Link to post
Vandrovnik 214 Posted February 12 9 minutes ago, Cristian Peța said: You have not posted a link and probably it's a stupid question but how to find a RSP by number? https://quality.embarcadero.com/browse/RSP-26436 When I already have a RSP open, I just overwrite the number at the end of the URL. 1 Share this post Link to post
Lajos Juhász 293 Posted February 12 (edited) 43 minutes ago, Cristian Peța said: You have not posted a link and probably it's a stupid question but how to find a RSP by number? 1.) Log into https://quality.embarcadero.com/ 2.) Enter RSP-26436 into search (you can find it at the upper right corner of the page) and you cannot copy paste it from the text above as it contains unicode characters. https://quality.embarcadero.com/browse/RSP-26436 Edited February 12 by Lajos Juhász it's right corner not left. 1 Share this post Link to post
Navid Madani 1 Posted February 12 (edited) 13 minutes ago, Cristian Peța said: You have not posted a link and probably it's a stupid question but how to find a RSP by number? https://quality.embarcadero.com/browse/RSP-26436 Such a fundamental pattern being broken, it could be a sign of more ominous problems. Edited February 12 by Navid Madani Share this post Link to post
Cristian Peța 103 Posted February 12 3 minutes ago, Lajos Juhász said: 2.) Enter RSP-26436 into search (you can find it at the upper left corner of the page) and you cannot copy paste it from the text above as it contains unicode characters. Finally... upper right corner (not left).... basic and advanced search doesn't work Share this post Link to post