As discussed in #156, following #154 the Z3 logical contexts are never garbage collected. This PR fixes this by adding a finalizer to the logical context pointer.
I'm also thinking this might be the right time to add some tests, in particular one that calls the finalizer on a context and checks that it has indeed been garbage collected.
As discussed in #156, following #154 the Z3 logical contexts are never garbage collected. This PR fixes this by adding a finalizer to the logical context pointer.