mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
hourglass.cpp: Avoid division by zero if no images are available.
This commit is contained in:
@@ -55,10 +55,19 @@ CHourGlass::CHourGlass( const int x_pos,
|
||||
initImageFiles();
|
||||
|
||||
hg_file_num = 0;
|
||||
if (!hg_img_files.empty())
|
||||
{
|
||||
hg_interval = interval == HG_AUTO_PAINT_INTERVAL ? (int64_t)(1000/hg_img_files.size()) : interval;
|
||||
hg_timer = new CComponentsTimer(hg_interval);
|
||||
hg_timer->OnTimer.connect(sigc::bind(sigc::mem_fun(*this, &CHourGlass::paint), true));
|
||||
}
|
||||
else
|
||||
{
|
||||
hg_timer = NULL;
|
||||
hg_interval = 0;
|
||||
dprintf(DEBUG_NORMAL, "[CHourGlass] [%s - %d] NOTE: No %s-images found..\n", __func__, __LINE__, hg_image_basename.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
CHourGlass::~CHourGlass()
|
||||
{
|
||||
|
Reference in New Issue
Block a user