Skip to content

Fix memory leaks in template Setup() bitmap loading#4

Open
EddieMac74 wants to merge 1 commit intoSDRplay:masterfrom
EddieMac74:fix/template-memory-leak
Open

Fix memory leaks in template Setup() bitmap loading#4
EddieMac74 wants to merge 1 commit intoSDRplay:masterfrom
EddieMac74:fix/template-memory-leak

Conversation

@EddieMac74
Copy link
Copy Markdown

Nine BYTE arrays allocated with new[] in SDRunoPlugin_TemplateForm::Setup() were never freed after being passed to Nana's img.open(). Since Nana copies the data internally during open(), the buffers serve no purpose after that call and should be released immediately.

Also removed the unused barfocusedPixels pointer which was declared but never initialized or referenced.

Affected file: SDRunoPlugin_Template/SDRunoPlugin_TemplateForm.cpp

Note: the same pattern exists in any plugin derived from this template and should be fixed there too.

Nine BYTE arrays allocated with new[] were never freed after being
passed to Nana's img.open(). Added matching delete[] calls immediately
after all open() calls. Also removed unused barfocusedPixels pointer
that was declared but never initialized or referenced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant