Changeset 384


Ignore:
Timestamp:
Jul 9, 2012, 3:58:43 PM (12 years ago)
Author:
chronos
Message:
 
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Common/Common.lpk

    r380 r384  
    2222    <License Value="GNU/GPL"/>
    2323    <Version Minor="7"/>
    24     <Files Count="14">
     24    <Files Count="15">
    2525      <Item1>
    2626        <Filename Value="StopWatch.pas"/>
     
    8282        <UnitName Value="UXMLUtils"/>
    8383      </Item14>
     84      <Item15>
     85        <Filename Value="UApplicationInfo.pas"/>
     86        <HasRegisterProc Value="True"/>
     87        <UnitName Value="UApplicationInfo"/>
     88      </Item15>
    8489    </Files>
    8590    <i18n>
  • Common/Common.pas

    r380 r384  
    1010  StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading,
    1111  UMemory, UResetableThread, UPool, ULastOpenedList, URegistry,
    12   UJobProgressView, UXMLUtils, LazarusPackageIntf;
     12  UJobProgressView, UXMLUtils, UApplicationInfo, LazarusPackageIntf;
    1313
    1414implementation
     
    1919  RegisterUnit('ULastOpenedList', @ULastOpenedList.Register);
    2020  RegisterUnit('UJobProgressView', @UJobProgressView.Register);
     21  RegisterUnit('UApplicationInfo', @UApplicationInfo.Register);
    2122end;
    2223
  • Common/URegistry.pas

    r371 r384  
    99
    1010type
     11  TRegistryRoot = (rrKeyClassesRoot = HKEY($80000000),
     12    rrKeyCurrentUser = HKEY($80000001),
     13    rrKeyLocalMachine = HKEY($80000002),
     14    rrKeyUsers = HKEY($80000003),
     15    rrKeyPerformanceData = HKEY($80000004),
     16    rrKeyCurrentConfig = HKEY($80000005),
     17    rrKeyDynData = HKEY($80000006));
    1118
    1219  { TRegistryEx }
  • Common/UThreading.pas

    r369 r384  
    303303  I: Integer;
    304304begin
     305  if Terminated then Exit;
    305306  SysUtils.Sleep(Delay mod Quantum);
    306307  for I := 1 to (Delay div Quantum) do begin
  • CoolStreaming/UVarBlockSerializer.pas

    r341 r384  
    4040    function GetVarSize: Integer;
    4141    function GetVarCount: Integer;
     42    function TryVarBlock: Boolean;
    4243
    4344    // Advanced data types
     
    450451end;
    451452
     453function TVarBlockSerializer.TryVarBlock: Boolean;
     454var
     455  Data: Byte;
     456  StoredPosition: Integer;
     457  Count: Integer;
     458begin
     459  if Stream.Position < Stream.Size then
     460  try
     461    StoredPosition := Stream.Position;
     462    Data := Stream.ReadByte;
     463    if Data = $ff then begin
     464      if TryVarBlock then begin
     465        Count := ReadVarUInt;
     466        Result := Count <= Stream.Size - Stream.Position;
     467      end else Result := False;
     468    end else begin
     469      Count := DecodeUnaryLength(Data) - 1;
     470      Result := Count <= Stream.Size - Stream.Position;
     471    end;
     472    Stream.Position := StoredPosition;
     473  except
     474    raise Exception.Create(SErrorGetVarSize);
     475  end else Result := False;
     476end;
     477
    452478procedure TVarBlockSerializer.WriteVarSInt(Value: Int64);
    453479begin
  • PinConnection/UCommThread.pas

    r302 r384  
    125125begin
    126126  Active := False;
    127   FInputBuffer.Free;
    128   FInputBufferLock.Free;
    129   Ext.Free;
    130   Pin.Free;
    131   FStatusEvent.Free;
    132   FDataAvailable.Free;
    133   inherited Destroy;
     127  FInputBufferLock.Acquire;
     128  FreeAndNil(FInputBuffer);
     129  FreeAndNil(FInputBufferLock);
     130  FreeAndNil(Ext);
     131  FreeAndNil(Pin);
     132  FreeAndNil(FStatusEvent);
     133  FreeAndNil(FDataAvailable);
     134  inherited;
    134135end;
    135136
Note: See TracChangeset for help on using the changeset viewer.