Crash when closing the GUI in Linux VST2 OpenGL

Hey!
For some reason the following code crashes the DAW when closing the GUI, only in Linux, only in VST2.
VST3 Linux works, VST2 Windows works.
Only tested it on Nvidia GPUs, but replicated at two different computers.
Crash doesn’t occur if commenting out the context.attachTo(*this); line.
Opens, draws, and operates perfectly fine until the GUI window is closed.
Any idea as to whats been causing it?
Thanks.

PluginEditor.h

#pragma once
#include "includes.h"
#include "functions.h"
#include "PluginProcessor.h"
using namespace gl;

class CRMBLAudioProcessorEditor : public AudioProcessorEditor, public OpenGLRenderer
{
public:
	CRMBLAudioProcessorEditor (CRMBLAudioProcessor&);
	~CRMBLAudioProcessorEditor() override;
	void newOpenGLContextCreated() override;
	void renderOpenGL() override;
	void openGLContextClosing() override;
	void paint(Graphics&) override;
	OpenGLContext context;
	JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CRMBLAudioProcessorEditor)
};

PluginEditor.cpp

#include "PluginProcessor.h"
#include "PluginEditor.h"

CRMBLAudioProcessorEditor::CRMBLAudioProcessorEditor (CRMBLAudioProcessor& p) : AudioProcessorEditor (&p) {
	setSize(512,512);
	context.setRenderer(this);
	context.attachTo(*this);
}
CRMBLAudioProcessorEditor::~CRMBLAudioProcessorEditor() {
	context.detach();
}
void CRMBLAudioProcessorEditor::newOpenGLContextCreated() { }
void CRMBLAudioProcessorEditor::renderOpenGL() {
	OpenGLHelpers::clear(Colour(100,0,0));
}
void CRMBLAudioProcessorEditor::openGLContextClosing() { }
void CRMBLAudioProcessorEditor::paint (Graphics& g) { }

Which host are you using for testing, and on what OS? Are you using the latest develop branch?

Thanks for getting back to me!
I’m using Reaper,
my OS is Kubuntu 22.04.1 LTS,
and ive previously was using JUCE 7.0.2, although today I’ve successfully reproduced it in JUCE 7.0.3 which came out 6 days ago.
Other Linux users were able to reproduce the bug on Reaper, although I’m not sure what their OS is.

Thanks for reporting this issue. It should be fixed here:

1 Like

That works! Thank you.