Skip to content

QOpenForRead returning closed objects? #1

@steelmats

Description

@steelmats

Thank you for this repo, it is awesome! However, I am experiencing stability issues when batch processing a large amount of blocks. I am suspecting that QOpenForRead can have part in this since they return a closed object:

   public static DBObject QOpenForRead(this ObjectId dboId, Database db)
    {
        using (Transaction trans = db.TransactionManager.StartOpenCloseTransaction())
        {
            return trans.GetObject(dboId, OpenMode.ForRead);
        }
    }

The using statement will call to close the object before returning it, and it is no longer guaranteed that the object can be used. See this post on the Autodesk forum.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions