Commit eb0c8c93 authored by Juha Manninen's avatar Juha Manninen
Browse files

Packager: Prevent Access Violation when creating a new component. Dependency...

Packager: Prevent Access Violation when creating a new component. Dependency was wrongly created. Issue #35145.

git-svn-id: trunk@60635 -
parent cabd06ba
......@@ -50,7 +50,6 @@ type
TAddToPkgResult = class
public
Pkg: TLazPackage;
Dependency: TPkgDependency;
UnitFilename: string;
Unit_Name: string;
AncestorType: string;
......@@ -520,7 +519,7 @@ begin
if (LazPackage<>ARequiredPackage)
and not LazPackage.Requires(PkgComponent.PkgFile.LazPackage)
then
fParams.Dependency:=ARequiredPackage.CreateDependencyWithOwner(nil);
PackageGraph.AddDependencyToPackage(LazPackage, ARequiredPackage);
end;
ModalResult:=mrOk;
end;
......@@ -657,7 +656,6 @@ end;
procedure TAddToPkgResult.Clear;
begin
FreeAndNil(Dependency);
UnitFilename:='';
Unit_Name:='';
AncestorType:='';
......@@ -674,7 +672,6 @@ end;
destructor TAddToPkgResult.Destroy;
begin
FreeThenNil(Next);
FreeAndNil(Dependency);
inherited Destroy;
end;
......
......@@ -2146,11 +2146,6 @@ var
LazPackage.Modified:=True;
FreeAndNil(FNextSelectedPart);
FNextSelectedPart:=TPENodeData.Create(penFile, UnitFilename, false);
// add dependency
if (Dependency<>nil) and not PkgDependsOn(Dependency.PackageName) then
PackageGraph.AddDependencyToPackage(LazPackage, Dependency);
if (IconNormFile<>'') and not PkgDependsOn('LCL') then
PackageGraph.AddDependencyToPackage(LazPackage, PackageGraph.LCLPackage);
PackageEditors.DeleteAmbiguousFiles(LazPackage, UnitFilename);
end;
// open file in editor
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment