Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions jlqml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ namespace qmlwrap
// Helper to store a Julia value of type Any in a GC-safe way
struct QVariantAny
{
QVariantAny(jl_value_t* v);
~QVariantAny();
inline QVariantAny(jl_value_t* v)
{
assert(v != nullptr);
jlcxx::protect_from_gc(value);
}
inline ~QVariantAny()
{
jlcxx::unprotect_from_gc(value);
}
jl_value_t* value;
};

Expand Down
10 changes: 0 additions & 10 deletions wrap_qml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ template<> struct SuperType<qmlwrap::JuliaImageProvider> { using type = QQuickIm
namespace qmlwrap
{

inline QVariantAny::QVariantAny(jl_value_t* v) : value(v)
{
assert(v != nullptr);
jlcxx::protect_from_gc(value);
}
inline QVariantAny::~QVariantAny()
{
jlcxx::unprotect_from_gc(value);
}

using qvariant_types = jlcxx::ParameterList<bool, float, double, int32_t, int64_t, uint32_t, uint64_t, void*, jl_value_t*,
QString, QUrl, jlcxx::SafeCFunction, QVariantMap, QVariantList, QStringList, QList<QUrl>, JuliaDisplay*, JuliaCanvas*, JuliaPropertyMap*, QObject*>;

Expand Down
Loading