View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029804 | Community | OCCT:Visualization | public | 2018-05-23 03:58 | 2018-05-25 11:14 |
Reporter | Vico Liang | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | no change required | ||
Platform | Android | OS | Android | ||
Product Version | 7.3.0 | ||||
Summary | 0029804: V3d_View::Remove() trigger error in sample AndroidQt | ||||
Description | In normal application design, V3d_View need to be removed when its host window or widget get destroyed, so i try to remove view in AndroidQt destructor. It will trigger the error as below: E libEGL : eglMakeCurrent:800 error 3002 (EGL_BAD_ACCESS) | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
What exactly are you trying to do? Please provide an updated sample. |
|
Steps to produce the issue: 1. Add a function in AndroidQt class AndroidQt::removeView() { myView->Remove(); } 2. Add a button on the QML file main.qml Button { id: control onClicked: viewer.removeView() } After removeView, the error message will occur in QtCreator output window: E libEGL : eglMakeCurrent:800 error 3002 (EGL_BAD_ACCESS) |
|
I mean V3d_View::Remove() should not call any opengl API, such as eglMakeCurrent. |
|
Why you need to do that in that way? QtQuick application is multi-threaded by default - it has two dedicated threads for GUI logic and for OpenGL rendering. Check Qt documentation on this topic. myView->Remove() is expected to be called from OpenGL rendering thread - this is why it emits the error message. |
|
I see that there are two threads for QtQuick. It seems not practicable to call myView->Remove() in OpenGL rendering thread, so where and how should we call Remove()? |
|
I want to use multiple views sharing a single viewer (graphic driver) and so when a view finished its task, it need to be removed from Viewer. |
|
Sorry, but questions about creation of multiple Views are out of scope of this sample - it is designed for the simplest case, with single View covering entire window. If you need help with these questions, you may try a luck on the User forum or contact Support Services. I have not tried (yet) such scenarios in QtQuick application, but would expect that there might be more issues to be solved at application (and, maybe, at OCCT site) apart from error message on View removal. |
|
Dear kgv, multiple Views are not present at the same time, they are switchable inside QML stackView or SwipView. each view is also covering the entire window. The problem is not multiple views, but the API V3d_view::Remove() method should not trigger error. |
|
I don't get why you need removing the View and not just sticking with single View and manipulating its properties, when needed. |
|
Thank you for you options. But anyway, even if there is an only view, its lifetime should be end up at some point. It's unavoidable to call Remove() function. |
|
Within this sample, removing of View is done at the end of application life, so that releasing of OpenGL and other memory objects would be a good style, but has no actual effect (and can actually take extra time without real need). Hence, error message can be just ignored in this case. |
|
It will call remove in V3d_View destructor, and also the error will be triggered even if not call V3d_View::Remove() explicitly. See below stack trace: V3d_View::~V3d_View() { if (!myView->IsRemoved()) { myView->Remove(); } } void OpenGl_View::Remove() { if (IsRemoved()) { return; } myDriver->RemoveView (this); myWindow.Nullify(); Graphic3d_CView::Remove(); } void OpenGl_GraphicDriver::RemoveView (const Handle(Graphic3d_CView)& theView) { Handle(OpenGl_Context) aCtx = GetSharedContext(); Handle(OpenGl_View) aView = Handle(OpenGl_View)::DownCast (theView); if (aView.IsNull()) { return; } if (!myMapOfView.Remove (aView)) { return; } Handle(OpenGl_Window) aWindow = aView->GlWindow(); if (!aWindow.IsNull() && aWindow->GetGlContext()->MakeCurrent()) { aCtx = aWindow->GetGlContext(); } else { // try to hijack another context if any const Handle(OpenGl_Context)& anOtherCtx = GetSharedContext(); if (!anOtherCtx.IsNull() && anOtherCtx != aWindow->GetGlContext()) { aCtx = anOtherCtx; aCtx->MakeCurrent(); } } aView->ReleaseGlResources (aCtx); if (myMapOfView.IsEmpty()) { // The last view removed but some objects still present. // Release GL resources now without object destruction. for (NCollection_DataMap<Standard_Integer, OpenGl_Structure*>::Iterator aStructIt (myMapOfStructure); aStructIt.More (); aStructIt.Next()) { OpenGl_Structure* aStruct = aStructIt.ChangeValue(); aStruct->ReleaseGlResources (aCtx); } if (!myMapOfStructure.IsEmpty()) { aView->StructureManager()->SetDeviceLost(); } } } |
|
> It will call remove in V3d_View destructor, > and also the error will be triggered > even if not call V3d_View::Remove() explicitly. See below stack trace: >> Hence, error message can be just ignored in this case. |
|
Agreed, the error message might can be ignored. |
|
Dear bugmaster, please close this issue. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-05-23 03:58 | Vico Liang | New Issue | |
2018-05-23 03:58 | Vico Liang | Assigned To | => kgv |
2018-05-23 04:00 | Vico Liang | Product Version | => 7.3.0 |
2018-05-23 04:02 | Vico Liang | OS | => Android |
2018-05-23 04:02 | Vico Liang | Platform | => Android |
2018-05-23 07:51 | kgv | Note Added: 0076115 | |
2018-05-23 07:51 | kgv | Assigned To | kgv => Vico Liang |
2018-05-23 07:51 | kgv | Status | new => feedback |
2018-05-23 10:01 | Vico Liang | Note Added: 0076123 | |
2018-05-23 10:03 | Vico Liang | Note Added: 0076124 | |
2018-05-23 10:04 | Vico Liang | Assigned To | Vico Liang => kgv |
2018-05-23 10:05 | Vico Liang | Status | feedback => assigned |
2018-05-23 10:05 | kgv | Note Added: 0076125 | |
2018-05-23 10:05 | kgv | Assigned To | kgv => Vico Liang |
2018-05-23 10:05 | kgv | Status | assigned => feedback |
2018-05-23 10:57 | Vico Liang | Note Added: 0076137 | |
2018-05-23 11:01 | Vico Liang | Note Added: 0076139 | |
2018-05-23 11:02 | Vico Liang | Assigned To | Vico Liang => kgv |
2018-05-23 11:02 | Vico Liang | Status | feedback => assigned |
2018-05-23 12:06 | kgv | Note Added: 0076152 | |
2018-05-23 12:06 | kgv | Assigned To | kgv => Vico Liang |
2018-05-23 12:06 | kgv | Status | assigned => feedback |
2018-05-23 12:07 | kgv | Resolution | open => no change required |
2018-05-23 12:27 | Vico Liang | Note Added: 0076161 | |
2018-05-23 12:31 | kgv | Note Added: 0076163 | |
2018-05-23 12:34 | Vico Liang | Assigned To | Vico Liang => kgv |
2018-05-23 12:34 | Vico Liang | Status | feedback => assigned |
2018-05-23 15:21 | Vico Liang | Note Added: 0076177 | |
2018-05-23 15:37 | kgv | Note Added: 0076179 | |
2018-05-23 16:23 | Vico Liang | Note Added: 0076184 | |
2018-05-23 16:25 | kgv | Note Added: 0076186 | |
2018-05-23 16:29 | Vico Liang | Note Added: 0076188 | |
2018-05-24 18:35 | kgv | Note Added: 0076294 | |
2018-05-24 18:35 | kgv | Assigned To | kgv => bugmaster |
2018-05-24 18:35 | kgv | Status | assigned => feedback |
2018-05-25 11:14 | bugmaster | Status | feedback => closed |