Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error JKQTPDatastore::addItem #144

Open
US3RN2ME opened this issue Nov 1, 2024 · 0 comments
Open

Runtime error JKQTPDatastore::addItem #144

US3RN2ME opened this issue Nov 1, 2024 · 0 comments

Comments

@US3RN2ME
Copy link

US3RN2ME commented Nov 1, 2024

I am trying to run BarChart example with Qt6 and this is what I get:

When things coming to the first addCopiedColumn, I got exception

size_t columnX=ds->addCopiedColumn(X, Ndata, "x"); // unhandled exception

I have traced the exception and it lead to addItem method which invokes QMap::insert method which causes exception

size_t JKQTPDatastore::addItem(JKQTPDatastoreItem* item) {
    /*items.push_back(item);
    return items.size()-1;*/
    items.insert(maxItemID, item); // exception is thrown from insert method
    maxItemID++;
    return maxItemID-1;
}

QMap::insert, basically the line where exception is thrown

iterator insert(const Key &key, const T &value)
{
    const auto copy = d.isShared() ? *this : QMap(); // Exception 0xc0000005 encountered at address 0x7ff84ac7ca71: Access violation reading location 0xffffffffffffffff
    detach();
    return iterator(d->m.insert_or_assign(key, value).first);
}

Exception occurs because of 'd' member variable which has such declaration inside QMap:

    using Map = std::map<Key, T>;
    using MapData = QMapData<Map>;
    QtPrivate::QExplicitlySharedDataPointerV2<MapData> d;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant