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

Crash while stepping through results of ExtractPropertyExp for ArrayProperties #939

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

naronchen
Copy link
Contributor

@@ -407,7 +407,10 @@ bool Class::Seek(ECInstanceId rowId, ECN::ECClassId& rowClassId) const {
// @bsimethod
//+---------------+---------------+---------------+---------------+---------------+------
bool Property::Seek(ECInstanceId rowId, ECN::ECClassId& rowClassId) const {
return m_table->Seek(rowId, &rowClassId);
OnAfterReset();
bool result = m_table->Seek(rowId, &rowClassId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TableView::Seek is implemented below in this file and public. Callers can just call ->GetTable()->Seek() instead, and we would be back to the crash, no?
@khanaffan please have a look at this, too. Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you referring to is private impl of InstanceReader (pimpl). All it set behind InstanceReader api. None of the nested classes is accessible to caller. Only thing they can access is InstanceReader. which only expose following and what you referring to set behind Impl* m_pImpl which is forward declaration. We do same with ECSqlStatement the impl has many public method with no intention to be called directly. This is to avoid friend semantic and including privately held data structures from being part of public header file. pImpl allow you to hide all your implementation from external user so you can break and change it without breaking external interface.

struct InstanceReader final {
 ...
 struct Impl;
    private:
        Impl* m_pImpl;
    public:
        InstanceReader(InstanceReader const&) = delete;
        InstanceReader& operator = (InstanceReader&) = delete;
        ECDB_EXPORT explicit InstanceReader(ECDbCR);
        ECDB_EXPORT ~InstanceReader();
        ECDB_EXPORT bool Seek(Position const&, RowCallback, Options const& = Options()) const;
        ECDB_EXPORT void Reset();
};

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

Successfully merging this pull request may close these issues.

3 participants