Browse Source

* open chm in nonexclusive mode. Could cause problems on Windows Vista where filelocks last even longer after closing.

git-svn-id: trunk@13599 -
marco 16 years ago
parent
commit
1399b7f8fb
1 changed files with 5 additions and 3 deletions
  1. 5 3
      ide/wchmhwrap.pas

+ 5 - 3
ide/wchmhwrap.pas

@@ -76,7 +76,7 @@ end;
 Constructor TChmWrapper.Create(name:string);
 Constructor TChmWrapper.Create(name:string);
 
 
 begin
 begin
-  ffs:=Classes.TFileStream.create(name,fmOpenRead);
+  ffs:=Classes.TFileStream.create(name,fmOpenRead or fmsharedenynone);
   fchmr:=TChmReader.Create(ffs,True); // owns ffs
   fchmr:=TChmReader.Create(ffs,True); // owns ffs
   findex:=nil;
   findex:=nil;
   if not fchmr.isvalidfile then
   if not fchmr.isvalidfile then
@@ -235,8 +235,10 @@ begin
   freeandnil(ftopic);
   freeandnil(ftopic);
   freeandnil(findex);
   freeandnil(findex);
   freeandnil(fchmr);
   freeandnil(fchmr);
+  {$ifdef wdebug}
+    debugmessageS({$i %file%},'TCHMWrapper: destroying ',{$i %line%},'1',0,0);
+  {$endif}
+
 end;
 end;
-// m:=r.getobject(r.indexfile);
-//  siteindex.loadfromStream(m);
 
 
 end.
 end.