[OCaml] Fix possible GC issues in generated director code
Make `classDirectorMethod()` generate `CAMLreturn_type()` or `CAMLreturn0` when there are local variables of type `value`.
This commit is contained in:
parent
df86ec5af6
commit
28a846705f
2 changed files with 23 additions and 5 deletions
15
Examples/test-suite/ocaml/director_unroll_runme.ml
Normal file
15
Examples/test-suite/ocaml/director_unroll_runme.ml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
open Swig
|
||||
open Director_unroll
|
||||
|
||||
let director_unroll_MyFoo ob meth args =
|
||||
match meth with
|
||||
| "ping" -> C_string "MyFoo::ping()"
|
||||
| _ -> (invoke ob) meth args
|
||||
|
||||
let a = new_derived_object
|
||||
new_Foo (director_unroll_MyFoo) '()
|
||||
|
||||
let b = new_Bar '()
|
||||
let _ = b -> set (a)
|
||||
let c = b -> get ()
|
||||
let _ = assert ((a -> "&" () as int) = (c -> "&" () as int))
|
||||
Loading…
Add table
Add a link
Reference in a new issue