Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hi,

 

wenn ich mit FreePascal/Lazarus das folgende Minimalbeispiel compiliere und ausfuehre (Connect/Disconnect) bekomme ich mit aktivem heaptrc eine Menge Fehler ueber nicht freigegebenen Speicher - siehe Screenshot.

 

Es sind dabei jeweils die aktuellsten Versionen von FreePascal und der TF-Bindings in Verwendung.

 

Kann mir jemand sagen, was ich hier falsch mache?

 

Dankeschoen!

 

 

 

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  SysUtils,
  Forms,
  Dialogs,
  StdCtrls,
  IPConnection;

type
  TForm1 = class(TForm)
    ConnectButton: TButton;
    DisconnectButton: TButton;
    procedure ConnectButtonClick(Sender: TObject);
    procedure DisconnectButtonClick(Sender: TObject);
  private
    AIPConnection: TIPConnection;
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

procedure TForm1.ConnectButtonClick(Sender: TObject);
begin
  AIPConnection := TIPConnection.Create;
  try
    AIPConnection.Connect('127.0.0.1', 4223);
  except
    on E: Exception do
      ShowMessage(E.Message);
  end;
end;

procedure TForm1.DisconnectButtonClick(Sender: TObject);
begin
  if Assigned(AIPConnection) and (AIPConnection.GetConnectionState = IPCON_CONNECTION_STATE_CONNECTED) then
    AIPConnection.Disconnect;
  FreeAndNil(AIPConnection);
end;

end.

1133428707_Screenshot_from_2015-08-09_012727.png.598969df967c9464d74cae0069209592.png

Geschrieben
  • Autor

Hi,

 

Du machst da nichts falsch, sondern hast einen Bug in den Bindings gefunden. Teste mal bitte die angehängte korrigierte Version von IPConnection.pas.

 

wenn ich den Test mit der neuen Version mit laufendem brickd durchfuehre, wird lt. heaptrc der gesamte Speicher wieder freigegeben.

 

Wenn ich das selbe ohne brickd mache, loese ich natuerlich eine Exception aus, aber auch durch Aufruf von .Free scheint irgendwas nicht freigegeben zu werden.

 

Danke und liebe Gruesse!

Geschrieben
  • Autor

* Connect/Disconnect mit brickd ohne angeschlossenem Master Brick: OK

 

* Connect/Disconnect mit brickd mit angeschlossenem Master Brick: OK

 

* Connect/Disconnect ohne brickd: OK

 

Super :) Vielen Dank!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.