FIX: Access violation when call CreateCalcStatisticsOperation for shared folder

This commit is contained in:
Alexander Koblov 2012-12-16 08:04:20 +00:00
commit 167aaefc4c
2 changed files with 8 additions and 3 deletions

View file

@ -282,7 +282,7 @@ end;
function TWinNetFileSource.CreateCalcStatisticsOperation(var theFiles: TFiles): TFileSourceOperation;
begin
if IsNetworkPath(theFiles.Path) then
if (NumCountChars(PathDelim, ExcludeTrailingPathDelimiter(theFiles.Path)) < 2) then
Result:= nil
else
Result:= inherited CreateCalcStatisticsOperation(theFiles);

View file

@ -2342,8 +2342,13 @@ begin
SelectedFiles := ActiveFrame.CloneSelectedOrActiveFiles;
try
Operation := ActiveFrame.FileSource.CreateCalcStatisticsOperation(SelectedFiles);
Operation.AddStateChangedListener([fsosStopped], @OnCalcStatisticsStateChanged);
OperationsManager.AddOperation(Operation);
if not Assigned(Operation) then
msgWarning(rsMsgErrNotSupported)
else
begin
Operation.AddStateChangedListener([fsosStopped], @OnCalcStatisticsStateChanged);
OperationsManager.AddOperation(Operation);
end;
finally
if Assigned(SelectedFiles) then
FreeAndNil(SelectedFiles);