mirror of
				https://github.com/AlexandreRouma/SDRPlusPlus.git
				synced 2025-11-04 02:39:11 +01:00 
			
		
		
		
	Fixed OpenGL memory leak
This commit is contained in:
		@@ -88,7 +88,7 @@ bool showMenu = true;
 | 
			
		||||
dsp::stream<dsp::complex_t> dummyStream;
 | 
			
		||||
 | 
			
		||||
void windowInit() {
 | 
			
		||||
    spdlog::info("Initializing SoapySDR");
 | 
			
		||||
    gui::waterfall.init();
 | 
			
		||||
 | 
			
		||||
    credits::init();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -107,6 +107,10 @@ namespace ImGui {
 | 
			
		||||
        updatePallette(COLOR_MAP, 13);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void WaterFall::init() {
 | 
			
		||||
        glGenTextures(1, &textureId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void WaterFall::drawFFT() {
 | 
			
		||||
        // Calculate scaling factor
 | 
			
		||||
        float startLine = floorf(fftMax / vRange) * vRange;
 | 
			
		||||
@@ -361,7 +365,6 @@ namespace ImGui {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void WaterFall::updateWaterfallTexture() {
 | 
			
		||||
        glGenTextures(1, &textureId);
 | 
			
		||||
        glBindTexture(GL_TEXTURE_2D, textureId);
 | 
			
		||||
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 | 
			
		||||
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,8 @@ namespace ImGui {
 | 
			
		||||
    public:
 | 
			
		||||
        WaterFall();
 | 
			
		||||
 | 
			
		||||
        void init();
 | 
			
		||||
 | 
			
		||||
        void draw();
 | 
			
		||||
        void pushFFT(std::vector<float> data, int n);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
    "bandPlan": "General",
 | 
			
		||||
    "bandPlanEnabled": true,
 | 
			
		||||
    "fftHeight": 298,
 | 
			
		||||
    "frequency": 98200000,
 | 
			
		||||
    "frequency": 100100000,
 | 
			
		||||
    "max": 0.0,
 | 
			
		||||
    "maximized": true,
 | 
			
		||||
    "menuOrder": [
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
{
 | 
			
		||||
    "device": "HackRF One #0 901868dc282c8f8b",
 | 
			
		||||
    "device": "Generic RTL2832U OEM :: 00000001",
 | 
			
		||||
    "devices": {
 | 
			
		||||
        "AirSpy HF+ [c852435de0224af7]": {
 | 
			
		||||
            "gains": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user