mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #7575 from jherico/oculus_crash
Don't release the Oculus plugin when disabling the plugin
This commit is contained in:
commit
7c6c75c484
2 changed files with 14 additions and 0 deletions
|
@ -52,6 +52,16 @@ void OculusDisplayPlugin::customizeContext() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OculusDisplayPlugin::uncustomizeContext() {
|
void OculusDisplayPlugin::uncustomizeContext() {
|
||||||
|
using namespace oglplus;
|
||||||
|
|
||||||
|
// Present a final black frame to the HMD
|
||||||
|
_compositeFramebuffer->Bound(FramebufferTarget::Draw, [] {
|
||||||
|
Context::ClearColor(0, 0, 0, 1);
|
||||||
|
Context::Clear().ColorBuffer();
|
||||||
|
});
|
||||||
|
|
||||||
|
hmdPresent();
|
||||||
|
|
||||||
#if (OVR_MAJOR_VERSION >= 6)
|
#if (OVR_MAJOR_VERSION >= 6)
|
||||||
_sceneFbo.reset();
|
_sceneFbo.reset();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -90,12 +90,16 @@ ovrSession acquireOculusSession() {
|
||||||
|
|
||||||
void releaseOculusSession() {
|
void releaseOculusSession() {
|
||||||
Q_ASSERT(refCount > 0 && session);
|
Q_ASSERT(refCount > 0 && session);
|
||||||
|
// HACK the Oculus runtime doesn't seem to play well with repeated shutdown / restart.
|
||||||
|
// So for now we'll just hold on to the session
|
||||||
|
#if 0
|
||||||
if (!--refCount) {
|
if (!--refCount) {
|
||||||
qCDebug(oculus) << "oculus: zero refcount, shutdown SDK and session";
|
qCDebug(oculus) << "oculus: zero refcount, shutdown SDK and session";
|
||||||
ovr_Destroy(session);
|
ovr_Destroy(session);
|
||||||
ovr_Shutdown();
|
ovr_Shutdown();
|
||||||
session = nullptr;
|
session = nullptr;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue