Add check for smart pointer type in generated code for director connection. This fixes a crash in the generated code caused by the dynamic_cast returning 0 because the specified types are incorrect for smart pointer types.

Add runtime test to the C# test suite's director smartptr test that demonstrates crash in generated code when directors are used with smart pointer types.

Closes #34
This commit is contained in:
Brant K. Kyser 2013-04-15 13:38:40 -05:00 committed by William S Fulton
commit 25eaee49f3
2 changed files with 53 additions and 2 deletions

View file

@ -0,0 +1,41 @@
using director_smartptrNamespace;
public class runme
{
private class director_smartptr_MyBarFoo : Foo
{
public override string ping()
{
return "director_smartptr_MyBarFoo.ping();";
}
public override string pong()
{
return "director_smartptr_MyBarFoo.pong();" + ping();
}
public override string fooBar(FooBar fooBar)
{
return fooBar.FooBarDo();
}
public override Foo makeFoo()
{
return new Foo();
}
public override FooBar makeFooBar()
{
return new FooBar();
}
}
static void Main()
{
director_smartptr_MyBarFoo myBarFoo =
new director_smartptr_MyBarFoo();
myBarFoo.ping();
}
}