Skip to content

Commit

Permalink
Fixed crashes when calling inlined constructors and destructors.
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitar Dobrev <[email protected]>
  • Loading branch information
ddobrev committed Feb 10, 2017
1 parent 5dc69ae commit 3a1df3e
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.7.1 - 10.2.2017
Fixed:
- Crashes when calling certain constructors and destructors.

0.7.0 - 5.2.2017
Added:
- Bindings for Qt 5.8.
Expand Down
12 changes: 6 additions & 6 deletions QtSharp.CLI/QtSharp.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.AST.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Generator, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Generator.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Parser.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Parser.CLI.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion QtSharp.CLI/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
<package id="CppSharp" version="0.8.3" targetFramework="net461" developmentDependency="true" />
<package id="CppSharp" version="0.8.4" targetFramework="net461" developmentDependency="true" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net461" />
</packages>
12 changes: 6 additions & 6 deletions QtSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ Global
{DBDEB3EE-2EB3-4F03-8276-A7D5A350EB95}.Release|Any CPU.Build.0 = Release|Any CPU
{DBDEB3EE-2EB3-4F03-8276-A7D5A350EB95}.Release|x86.ActiveCfg = Release|x86
{DBDEB3EE-2EB3-4F03-8276-A7D5A350EB95}.Release|x86.Build.0 = Release|x86
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Debug|x86.ActiveCfg = Debug|Any CPU
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Release|Any CPU.Build.0 = Release|Any CPU
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Release|x86.ActiveCfg = Release|Any CPU
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Debug|Any CPU.ActiveCfg = Debug|x86
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Debug|x86.ActiveCfg = Debug|x86
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Debug|x86.Build.0 = Debug|x86
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Release|Any CPU.ActiveCfg = Release|x86
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Release|x86.ActiveCfg = Release|x86
{5E8F503D-1B37-4298-855D-06F81B5B4630}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions QtSharp/GenerateEventEventsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public override bool VisitTranslationUnit(TranslationUnit unit)

private void OnUnitGenerated(GeneratorOutput generatorOutput)
{
var blocks = (from template in generatorOutput.Templates
from block in template.FindBlocks(CSharpBlockKind.Method)
var blocks = (from output in generatorOutput.Outputs
from block in output.FindBlocks(CSharpBlockKind.Method)
where this.events.Contains(block.Object)
select block).ToList();
foreach (var block in blocks)
Expand Down
17 changes: 8 additions & 9 deletions QtSharp/GenerateSignalEventsPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ private void OnUnitGenerated(GeneratorOutput generatorOutput)

private void GenerateSignalEvents(GeneratorOutput generatorOutput)
{
foreach (var block in from template in generatorOutput.Templates
from block in template.FindBlocks(CSharpBlockKind.Event)
foreach (var block in from output in generatorOutput.Outputs
from block in output.FindBlocks(CSharpBlockKind.Event)
select block)
{
Event @event = (Event) block.Object;
Expand Down Expand Up @@ -118,13 +118,12 @@ from e in @event.Parameters
}}", fullNameBuilder, finalName, signature));
}
}
var qtMetacall = (
from template in generatorOutput.Templates
from block in template.FindBlocks(CSharpBlockKind.Method)
let declaration = block.Object as Declaration
where declaration != null && declaration.Name == "QtMetacall" &&
declaration.Namespace.Name == "QObject"
select block).FirstOrDefault();
var qtMetacall = (from output in generatorOutput.Outputs
from block in output.FindBlocks(CSharpBlockKind.Method)
let declaration = block.Object as Declaration
where declaration != null && declaration.Name == "QtMetacall" &&
declaration.Namespace.Name == "QObject"
select block).FirstOrDefault();
if (qtMetacall != null)
{
qtMetacall.Text.StringBuilder.Replace("return __ret;", "return HandleQtMetacall(__ret, _0, _2);");
Expand Down
12 changes: 6 additions & 6 deletions QtSharp/QtSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.AST, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.AST.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.AST.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Generator, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Generator.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Generator.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Parser.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Parser.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Parser.CLI, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Parser.CLI.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Parser.CLI.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CppSharp.Runtime, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CppSharp.0.8.3\lib\CppSharp.Runtime.dll</HintPath>
<HintPath>..\packages\CppSharp.0.8.4\lib\CppSharp.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion QtSharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Baseclass.Contrib.Nuget.Output" version="2.1.0" targetFramework="net451" />
<package id="CppSharp" version="0.8.3" targetFramework="net461" developmentDependency="true" />
<package id="CppSharp" version="0.8.4" targetFramework="net461" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net451" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net461" />
<package id="zlib.net" version="1.0.4" targetFramework="net451" />
Expand Down

0 comments on commit 3a1df3e

Please sign in to comment.