#include "accessobject.h"
#include "accessclass.h"
#include "util.h"
#include <QSet>
#include <QQmlEngine>

namespace RubyQml {

AccessObject::AccessObject(const SP<ForeignClass> &klass, VALUE value) :
    ForeignObject(klass),
    mValue(value)
{
    globalMarkValues() << value;
    QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership);
}

AccessObject::~AccessObject()
{
    globalMarkValues().remove(mValue);
}

} // namespace RubyQml

#include "accessobject.h"
#include "accessclass.h"
#include "util.h"
#include <QSet>

namespace RubyQml {

AccessObject::AccessObject(const SP<ForeignClass> &klass, VALUE value) :
    ForeignObject(klass),
    mValue(value)
{
    globalMarkValues() << value;
}

AccessObject::~AccessObject()
{
    globalMarkValues().remove(mValue);
}

} // namespace RubyQml

Revert "AccessObject objects are owned by QML"
Revert "AccessObject objects are owned by QML"

This reverts commit 79352321388304c7ff2fc5ecdcf78b35e5958b33.
