Subject: [ruby-ffi] Re: FFI::ManagedStruct #release method |
From: Wayne Meissner |
Date: 10/20/13 10:03 PM |
To: ruby-ffi@googlegroups.com |
I'm using FFI::ManagedStruct in a project of mine to be sure to clean up my memory. The question I have is around what happens if that call fails. The reason that I ask is because I had renamed the function and forgot to reflect this in the self.release definition. I expected this to raise an exception as my function wasn't defined. Is there a way to make this more obvious to me if this happens again?class MyManagedStruct < FFI::ManagedStructlayout :name, :string,:ids, :pointer,:ids_length, :intdef self.releaseMyLibrary.release_my_struct# MyLibrary.oops_this_is_not_named_correctly does not fail endendThanks in advance,Levi