[Lazarus] Still some problems with PackageEditingInterface.DoOpenPackageFile

Ludo Brands ludo.brands at free.fr
Sun Jan 8 17:12:31 CET 2012


Hi,

In case I recreate a package that is already installed in lazarus,
PackageEditingInterface.DoOpenPackageFile will bring up the package but as
soon as I hit compile, it shows a message that the disk file has changes in
between. 
Ignoring or reloading, crashes lazarus with (ignoring in this case):

TPkgManager.DoCompilePackage A AXVLC_1_0_TLBP 0.1 Flags=[]
[TMainIDE.Destroy] A
TApplication.HandleException Access violation
  Stack trace:
  $00C38868  TPACKAGEEDITORS__DOFREEEDITOR,  line 2400 of
C:/lazarus/packager/pa
ckageeditor.pas
  $00C3838D  TPACKAGEEDITORFORM__DESTROY,  line 2301 of
C:/lazarus/packager/pack
ageeditor.pas
  $0040D0C2  TOBJECT__FREE,  line 278 of
C:/lazarus/fpc/svn/rtl/inc/objpas.inc
  $0083E57A  TLAZPACKAGEGRAPH__DELETE,  line 709 of
C:/lazarus/packager/packages
ystem.pas
  $0083E4FB  TLAZPACKAGEGRAPH__CLEAR,  line 697 of
C:/lazarus/packager/packagesy
stem.pas
  $0083E441  TLAZPACKAGEGRAPH__DESTROY,  line 684 of
C:/lazarus/packager/package
system.pas
  $0040D0C2  TOBJECT__FREE,  line 278 of
C:/lazarus/fpc/svn/rtl/inc/objpas.inc
  $00854D01  TPKGMANAGER__DESTROY,  line 1565 of
C:/lazarus/packager/pkgmanager.
pas
  $0040D0C2  TOBJECT__FREE,  line 278 of
C:/lazarus/fpc/svn/rtl/inc/objpas.inc
  $00449B8A  TMAINIDE__DESTROY,  line 1534 of main.pp
  $0040D0C2  TOBJECT__FREE,  line 278 of
C:/lazarus/fpc/svn/rtl/inc/objpas.inc
  $004272FD  BEFOREFINALIZATION,  line 1780 of forms.pp
  $0040F839  INTERNALEXIT,  line 867 of
C:/lazarus/fpc/svn/rtl/inc/system.inc
  $0040478C  FPC_CHECK_OBJECT,  line 826 of
C:/lazarus/fpc/svn/rtl/inc/generic.i
nc
  $008595A8  TPKGMANAGER__DOCOMPILEPACKAGE,  line 2627 of
C:/lazarus/packager/pk
gmanager.pas
  $00850921  TPKGMANAGER__ONPACKAGEEDITORCOMPILEPACKAGE,  line 603 of
C:/lazarus
/packager/pkgmanager.pas
  $00C38992  TPACKAGEEDITORS__COMPILEPACKAGE,  line 2427 of
C:/lazarus/packager/
packageeditor.pas

It seems installed packages are already pre-loaded and the window that is
brought up with PackageEditingInterface.DoOpenPackageFile is actually a
cached version before the overwrite. This is somewhat confirmed when I
delete the .lpk file of an installed package as it will bring up the package
editor for that package with the warning that the diskfile has changed. 

I'm doing now
if PackageEditingInterface.FindPackageWithName(PkgName)<>nil then
 
PackageEditingInterface.DoOpenPackageFile(sDir+PkgName+'.lpk',[pofRevert],fa
lse)
else
 
PackageEditingInterface.DoOpenPackageFile(sDir+PkgName+'.lpk',[pofAddToRecen
t],false);

but FindPackageWithName returns nil. What can I do?


Thanks, Ludo
 






More information about the Lazarus mailing list