void OpenGLComponent::updateContext() { if (needToDeleteContext) deleteContext(); if (context == nullptr) { const ScopedLock sl (contextLock); if (context == nullptr) { context = createContext(); if (context != nullptr) { #if JUCE_LINUX if (! isUsingDedicatedThread()) #endif updateContextPosition(); if (context->makeActive()) { newOpenGLContextCreated(); context->makeInactive(); } } } } }
OpenGLComponent::~OpenGLComponent() { if (isUsingDedicatedThread()) stopBackgroundThread(); else deleteContext(); componentWatcher = nullptr; }
bool Buffer::checkAndErrorDedicatedThreadPresent(std::string* error_str) const { if (isUsingDedicatedThread()) return true; if (error_str) *error_str = tf2_ros::threading_error; ROS_ERROR("%s", tf2_ros::threading_error.c_str()); return false; }
OpenGLComponent::~OpenGLComponent() { if (isUsingDedicatedThread()) { /* If you're using a background thread, then your sub-class MUST call stopRenderThread() in its destructor! Otherwise, the thread could still be running while your sub-class isbeing destroyed, and so may make a call to your subclass's renderOpenGL() method when it no longer exists! */ jassert (renderThread == nullptr); stopRenderThread(); } else { deleteContext(); } componentWatcher = nullptr; }