Using XE6 Update1, Vcl.
Using XE6 Update1, Vcl.Styles and FastMM 4.991 in full debug mode, I'm getting block being modified after being freed followed by out of memory error.
Has anyone else seen this ?
I can reproduce it in a small app that has a main menu with a drop down menu with one item. That item does a ShowMessage in its on click event. The Style is set using the application options, and FastMM is included in the dpr, overriding the built in version shipped with Delphi. Run the app and click on the menu item and then the drop down item. Error message is display from FastMM, 'block has been modified after being freed', followed by Out of Memory exception.
Any ideas about how to get around this, other than not using full debug mode ? It all worked fine in XE4.
Sue
The differences in options between the distributed FastMM4Options.inc and the one I use are :
$define UseRunTimePackages
$define AssumeMultiThreaded
$define NoDebugInfo
$define CheckHeapForCorruption
$define FullDebugMode
$define CatchUseOfFreedInterfaces
$define ClearLogFileOnStartUp
$define ManualLeakReporting
$define HideMemoryLeakHintMessage
$define FullDebugModeWhenDLLAvailable
plus changes to the group options section which reflect the changes above
Code to reproduce :
program TestMemLoop;
uses
FastMM4 in '..\..\..\Tools\FastMM\FastMM4.pas',
Vcl.Forms,
memtest_main in 'memtest_main.pas' {Form3},
Vcl.Themes,
Vcl.Styles,
FastMM4Messages in '..\..\..\Tools\FastMM\FastMM4Messages.pas';
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
TStyleManager.TrySetStyle('Luna');
Application.CreateForm(TForm3, Form3);
Application.Run;
end.
unit memtest_main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus;
type
TForm3 = class(TForm)
MainMenu1: TMainMenu;
File1: TMenuItem;
LogOn1: TMenuItem;
mmuOption: TMenuItem;
procedure LogOn1Click(Sender: TObject);
procedure mmuOptionClick(Sender: TObject);
private
Fhere: Boolean;
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.LogOn1Click(Sender: TObject);
begin
showmessage('ok');
Fhere := True;
end;
procedure TForm3.mmuOptionClick(Sender: TObject);
begin
ShowMessage('option');
end;
end.
object Form3: TForm3
Left = 0
Top = 0
Caption = 'Form3'
ClientHeight = 239
ClientWidth = 427
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Menu = MainMenu1
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object MainMenu1: TMainMenu
Left = 26
Top = 14
object File1: TMenuItem
Caption = 'File'
object LogOn1: TMenuItem
Caption = 'Log On'
OnClick = LogOn1Click
end
end
object mmuOption: TMenuItem
Caption = 'Option'
OnClick = mmuOptionClick
end
end
end
Has anyone else seen this ?
I can reproduce it in a small app that has a main menu with a drop down menu with one item. That item does a ShowMessage in its on click event. The Style is set using the application options, and FastMM is included in the dpr, overriding the built in version shipped with Delphi. Run the app and click on the menu item and then the drop down item. Error message is display from FastMM, 'block has been modified after being freed', followed by Out of Memory exception.
Any ideas about how to get around this, other than not using full debug mode ? It all worked fine in XE4.
Sue
The differences in options between the distributed FastMM4Options.inc and the one I use are :
$define UseRunTimePackages
$define AssumeMultiThreaded
$define NoDebugInfo
$define CheckHeapForCorruption
$define FullDebugMode
$define CatchUseOfFreedInterfaces
$define ClearLogFileOnStartUp
$define ManualLeakReporting
$define HideMemoryLeakHintMessage
$define FullDebugModeWhenDLLAvailable
plus changes to the group options section which reflect the changes above
Code to reproduce :
program TestMemLoop;
uses
FastMM4 in '..\..\..\Tools\FastMM\FastMM4.pas',
Vcl.Forms,
memtest_main in 'memtest_main.pas' {Form3},
Vcl.Themes,
Vcl.Styles,
FastMM4Messages in '..\..\..\Tools\FastMM\FastMM4Messages.pas';
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
TStyleManager.TrySetStyle('Luna');
Application.CreateForm(TForm3, Form3);
Application.Run;
end.
unit memtest_main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus;
type
TForm3 = class(TForm)
MainMenu1: TMainMenu;
File1: TMenuItem;
LogOn1: TMenuItem;
mmuOption: TMenuItem;
procedure LogOn1Click(Sender: TObject);
procedure mmuOptionClick(Sender: TObject);
private
Fhere: Boolean;
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.LogOn1Click(Sender: TObject);
begin
showmessage('ok');
Fhere := True;
end;
procedure TForm3.mmuOptionClick(Sender: TObject);
begin
ShowMessage('option');
end;
end.
object Form3: TForm3
Left = 0
Top = 0
Caption = 'Form3'
ClientHeight = 239
ClientWidth = 427
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Menu = MainMenu1
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object MainMenu1: TMainMenu
Left = 26
Top = 14
object File1: TMenuItem
Caption = 'File'
object LogOn1: TMenuItem
Caption = 'Log On'
OnClick = LogOn1Click
end
end
object mmuOption: TMenuItem
Caption = 'Option'
OnClick = mmuOptionClick
end
end
end
Comments
Post a Comment