Put dbrow and fetch into a scope so that it goes away quick

This commit is contained in:
Isaac Connor 2021-04-20 10:55:39 -04:00
parent 0343642c42
commit b6fcadf31b
1 changed files with 5 additions and 3 deletions

View File

@ -97,9 +97,11 @@ Event::Event(
}
unsigned int state_id = 0;
zmDbRow dbrow;
if ( dbrow.fetch("SELECT Id FROM States WHERE IsActive=1") ) {
state_id = atoi(dbrow[0]);
{
zmDbRow dbrow;
if (dbrow.fetch("SELECT Id FROM States WHERE IsActive=1")) {
state_id = atoi(dbrow[0]);
}
}
// Copy it in case opening the mp4 doesn't work we can set it to another value