Skip to content

Commit

Permalink
Don't call Julia API functions in finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Apr 19, 2016
1 parent e907e38 commit 61ae68a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions deps/src/cxx_wrap/type_conversion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ inline CppT convert_to_cpp(const JuliaT& julia_val)

namespace detail
{
/// Equivalent of the basic C++ type layout in Julia
struct WrappedCppPtr {
JL_DATA_TYPE
jl_value_t* voidptr;
};

template<bool, typename T1, typename T2>
struct DispatchBits;

Expand Down Expand Up @@ -109,7 +115,7 @@ namespace detail
delete stored_obj;
}

jl_set_nth_field(to_delete, 0, jl_box_voidpointer(nullptr));
reinterpret_cast<WrappedCppPtr*>(to_delete)->voidptr = nullptr;
}

// Julia 0.4 version
Expand Down Expand Up @@ -706,12 +712,6 @@ struct DoUnpack<std::false_type, std::false_type>
}
};

/// Equivalent of the basic C++ type layout in Julia
struct WrappedCppPtr {
JL_DATA_TYPE
jl_value_t* voidptr;
};

/// Helper class to unpack a julia type
template<typename CppT>
struct JuliaUnpacker
Expand Down

0 comments on commit 61ae68a

Please sign in to comment.