Merge pull request #7575 from jherico/oculus_crash

Don't release the Oculus plugin when disabling the plugin
This commit is contained in:
Brad Hefta-Gaub 2016-04-05 13:50:46 -07:00
commit 7c6c75c484
2 changed files with 14 additions and 0 deletions

View file

@ -52,6 +52,16 @@ void OculusDisplayPlugin::customizeContext() {
}
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)
_sceneFbo.reset();
#endif

View file

@ -90,12 +90,16 @@ ovrSession acquireOculusSession() {
void releaseOculusSession() {
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) {
qCDebug(oculus) << "oculus: zero refcount, shutdown SDK and session";
ovr_Destroy(session);
ovr_Shutdown();
session = nullptr;
}
#endif
}