diff --git a/Examples/test-suite/php/exception_memory_leak_runme.php b/Examples/test-suite/php/exception_memory_leak_runme.php index 3972bb90f..116ab2f0e 100644 --- a/Examples/test-suite/php/exception_memory_leak_runme.php +++ b/Examples/test-suite/php/exception_memory_leak_runme.php @@ -17,7 +17,7 @@ trigger_internal_swig_exception("no problem", $a); check::equal(Foo::get_count(), 2, "Should have 2 Foo objects"); check::equal(Foo::get_freearg_count(), 1, "freearg should have been used once"); -// SWIG exception triggered and handled. +// SWIG exception triggered and handled (return new object case). try { trigger_internal_swig_exception("null", $b); check::fail("Expected exception not thrown"); @@ -25,3 +25,11 @@ try { } check::equal(Foo::get_count(), 2, "Should have 2 Foo objects"); check::equal(Foo::get_freearg_count(), 2, "freearg should have been used twice"); + +// SWIG exception triggered and handled (return by value case). +try { + trigger_internal_swig_exception("null"); + check::fail("Expected exception not thrown"); +} catch (Exception $e) { +} +check::equal(Foo::get_count(), 2, "Should have 2 Foo objects");