Ignore:
Timestamp:
Jan 21, 2018, 11:33:15 PM (6 years ago)
Author:
chronos
Message:
  • Added: Locking of video memory because it is accessed by main thread and also application threads.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Kernel/UDevice.pas

    r17 r19  
    66
    77uses
    8   Classes, SysUtils, Contnrs, UList, UGraphics;
     8  Classes, SysUtils, Contnrs, UList, UGraphics, syncobjs;
    99
    1010type
     
    3636    function GetVideoMemory: PByte; virtual;
    3737  public
     38    Lock: TCriticalSection;
    3839    constructor Create; override;
     40    destructor Destroy; override;
    3941    procedure GetSupportedModes(Modes: TObjectList); virtual;
    4042    procedure VideoMemoryChange; virtual;
     
    104106  ClassName := 'Video device';
    105107  FVideoMode := TVideoMode.Create;
     108  Lock := TCriticalSection.Create;
     109end;
     110
     111destructor TDeviceVideo.Destroy;
     112begin
     113  Lock.Free;
     114  FVideoMode.Free;
     115  inherited Destroy;
    106116end;
    107117
Note: See TracChangeset for help on using the changeset viewer.