mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
fix: Memoryleaks & Coredump, if no Grabber compiled (#724)
* Fix Memoryleaks & Coredump, if no Grabber * Fix Memoryleaks & Coredump, if no Grabber
This commit is contained in:
parent
1fb14b2002
commit
49b30c47f7
@ -69,8 +69,11 @@ void ImageProcessor::setSize(const unsigned width, const unsigned height)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( _imageToLeds != nullptr)
|
||||
{
|
||||
// Clean up the old buffer and mapping
|
||||
_imageToLeds = 0;
|
||||
delete _imageToLeds;
|
||||
}
|
||||
|
||||
// Construct a new buffer and mapping
|
||||
_imageToLeds = (width>0 && height>0) ? (new ImageToLedsMap(width, height, 0, 0, _ledString.leds())) : nullptr;
|
||||
@ -78,17 +81,20 @@ void ImageProcessor::setSize(const unsigned width, const unsigned height)
|
||||
|
||||
void ImageProcessor::setLedString(const LedString& ledString)
|
||||
{
|
||||
if ( _imageToLeds != nullptr)
|
||||
{
|
||||
_ledString = ledString;
|
||||
|
||||
// get current width/height
|
||||
const unsigned width = _imageToLeds->width();
|
||||
const unsigned height = _imageToLeds->height();
|
||||
unsigned width = _imageToLeds->width();
|
||||
unsigned height = _imageToLeds->height();
|
||||
|
||||
// Clean up the old buffer and mapping
|
||||
_imageToLeds = 0;
|
||||
delete _imageToLeds;
|
||||
|
||||
// Construct a new buffer and mapping
|
||||
_imageToLeds = new ImageToLedsMap(width, height, 0, 0, _ledString.leds());
|
||||
}
|
||||
}
|
||||
|
||||
void ImageProcessor::setBlackbarDetectDisable(bool enable)
|
||||
|
Loading…
x
Reference in New Issue
Block a user