Einzelnen Beitrag anzeigen

dpg123

Registriert seit: 13. Apr 2015
22 Beiträge
 
Turbo Delphi für Win32
 
#12

AW: Memory Leak bei Interface Delegation

  Alt 4. Nov 2016, 14:44
Entschuldigt die späte Rückmeldung!

Ich muss noch mal nachfragen: sehe ich es richtig, dass es mit folgender Deklaration

Delphi-Quellcode:
type
  IMyInterface = interface
    procedure Show;
  end;

  TMyClass = class(TAggregatedObject, IMyInterface)
    procedure Show;
  end;

  TMyWrapper = class(TInterfacedObject, IMyInterface)
  private
    FMyInterface: IMyInterface;
  public
    constructor Create;
    property MyInterface: IMyInterface read FMyInterface implements IMyInterface;
  end;
keine sauber Implementation ohne manuelles Freigeben von FMyInterface gibt? Und wie sähe diese mit Freigeben aus?

Dank und Gruß!

Geändert von dpg123 ( 4. Nov 2016 um 14:47 Uhr)
  Mit Zitat antworten Zitat