cdew / omnithreadlibrary

Automatically exported from code.google.com/p/omnithreadlibrary
0 stars 0 forks source link

TOmniCS.LockCount causes A/V when not initialized #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

var
  Lock: TOmniCS;
begin
  if Lock.LockCount > 0 then
    ;
end;

What is the expected output? What do you see instead?

Access violation (trying to access a property of ocsSync which is nil)

What version of the product are you using? On what operating system?

Delphi 2007 / Windows 8.1

Please provide any additional information below.

Suggested fix:

function TOmniCS.GetLockCount: integer;
begin
  Result := 0;
  if Assigned(ocsSync) then
    Result := ocsSync.LockCount;
end; { TOmniCS.GetLockCount }

Original issue reported on code.google.com by fdcas...@gmail.com on 17 Mar 2014 at 12:20

GoogleCodeExporter commented 9 years ago

Original comment by gabr42 on 17 Apr 2015 at 5:40