mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Protect call by critical section
This commit is contained in:
parent
e796b5a02c
commit
f8f2d454bb
2 changed files with 27 additions and 17 deletions
|
|
@ -125,28 +125,38 @@ end;
|
|||
function TExifWdx.CallContentGetValueV(FileName: String; FieldIndex,
|
||||
UnitIndex: Integer; flags: Integer): Variant;
|
||||
begin
|
||||
GetData(FileName);
|
||||
case FieldIndex of
|
||||
0: Result:= FExif.Make;
|
||||
1: Result:= FExif.Model;
|
||||
2: Result:= FExif.ImageWidth;
|
||||
3: Result:= FExif.ImageHeight;
|
||||
4: Result:= FExif.Orientation;
|
||||
5: Result:= FExif.DateTimeOriginal;
|
||||
EnterCriticalSection(FMutex);
|
||||
try
|
||||
GetData(FileName);
|
||||
case FieldIndex of
|
||||
0: Result:= FExif.Make;
|
||||
1: Result:= FExif.Model;
|
||||
2: Result:= FExif.ImageWidth;
|
||||
3: Result:= FExif.ImageHeight;
|
||||
4: Result:= FExif.Orientation;
|
||||
5: Result:= FExif.DateTimeOriginal;
|
||||
end;
|
||||
finally
|
||||
LeaveCriticalSection(FMutex);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TExifWdx.CallContentGetValue(FileName: String; FieldIndex,
|
||||
UnitIndex: Integer; flags: Integer): String;
|
||||
begin
|
||||
GetData(FileName);
|
||||
case FieldIndex of
|
||||
0: Result:= FExif.Make;
|
||||
1: Result:= FExif.Model;
|
||||
2: Result:= IntToStr(FExif.ImageWidth);
|
||||
3: Result:= IntToStr(FExif.ImageHeight);
|
||||
4: Result:= IntToStr(FExif.Orientation);
|
||||
5: Result:= FExif.DateTimeOriginal;
|
||||
EnterCriticalSection(FMutex);
|
||||
try
|
||||
GetData(FileName);
|
||||
case FieldIndex of
|
||||
0: Result:= FExif.Make;
|
||||
1: Result:= FExif.Model;
|
||||
2: Result:= IntToStr(FExif.ImageWidth);
|
||||
3: Result:= IntToStr(FExif.ImageHeight);
|
||||
4: Result:= IntToStr(FExif.Orientation);
|
||||
5: Result:= FExif.DateTimeOriginal;
|
||||
end;
|
||||
finally
|
||||
LeaveCriticalSection(FMutex);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ type
|
|||
{ TWDXModule }
|
||||
|
||||
TWDXModule = class
|
||||
private
|
||||
protected
|
||||
FMutex: TRTLCriticalSection;
|
||||
protected
|
||||
function GetAName: String; virtual; abstract;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue