From b6fcadf31b5d691d00fe08675b95179caffcea4e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 20 Apr 2021 10:55:39 -0400 Subject: [PATCH] Put dbrow and fetch into a scope so that it goes away quick --- src/zm_event.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index e1ff38440..f0120d7de 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -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