Changeset 7 for os/trunk/System


Ignore:
Timestamp:
Jun 2, 2013, 6:59:07 PM (12 years ago)
Author:
chronos
Message:
  • Fixed: Components now have list of childs and free them on destruction.
  • Fixed: Memory leaks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • os/trunk/System/LDOS.Kernel.pas

    r6 r7  
    2121    procedure Execute; virtual;
    2222    procedure Terminate; virtual;
     23    destructor Destroy; override;
    2324  end;
    2425
     
    8788    procedure HandleTaskList;
    8889  public
    89     Timers: TList<TTimer>;
    90     Processes: TList<TProcess>;
    91     Drivers: TList<TDriver>;
     90    Timers: TObjectList<TTimer>;
     91    Processes: TObjectList<TProcess>;
     92    Drivers: TObjectList<TDriver>;
    9293    StartOnBoot: TList<TApplication>;
    9394    Screen: TScreen;
     
    135136constructor TKernel.Create;
    136137begin
    137   Processes := TList<TProcess>.Create;
    138   Timers := TList<TTimer>.Create;
    139   Drivers := TList<TDriver>.Create;
     138  Processes := TObjectList<TProcess>.Create;
     139  Timers := TObjectList<TTimer>.Create;
     140  Drivers := TObjectList<TDriver>.Create;
    140141  Screen := TScreen.Create;
    141142  Screen.Kernel := Self;
     
    227228  Canvas.Destroy;
    228229  Forms.Destroy;
     230  VideoDevice.Destroy;
    229231  inherited;
    230232end;
     
    311313
    312314{ TProcess }
     315
     316destructor TProcess.Destroy;
     317begin
     318  if Assigned(Application) then Application.Destroy;
     319  inherited;
     320end;
    313321
    314322procedure TProcess.Execute;
Note: See TracChangeset for help on using the changeset viewer.