Merge branch 'master' into swresample

This commit is contained in:
Isaac Connor 2018-12-20 13:48:37 -05:00
commit 8b239752ae
1 changed files with 9 additions and 2 deletions

View File

@ -626,6 +626,13 @@ Debug(3, "Success connecting");
} }
Monitor::~Monitor() { Monitor::~Monitor() {
if ( n_linked_monitors ) {
for( int i = 0; i < n_linked_monitors; i++ ) {
delete linked_monitors[i];
}
delete[] linked_monitors;
linked_monitors = 0;
}
if ( timestamps ) { if ( timestamps ) {
delete[] timestamps; delete[] timestamps;
timestamps = 0; timestamps = 0;
@ -1906,15 +1913,15 @@ void Monitor::ReloadLinkedMonitors(const char *p_linked_monitors) {
static char sql[ZM_SQL_SML_BUFSIZ]; static char sql[ZM_SQL_SML_BUFSIZ];
snprintf(sql, sizeof(sql), "select Id, Name from Monitors where Id = %d and Function != 'None' and Function != 'Monitor' and Enabled = 1", link_ids[i] ); snprintf(sql, sizeof(sql), "select Id, Name from Monitors where Id = %d and Function != 'None' and Function != 'Monitor' and Enabled = 1", link_ids[i] );
if ( mysql_query(&dbconn, sql) ) { if ( mysql_query(&dbconn, sql) ) {
Error("Can't run query: %s", mysql_error(&dbconn));
db_mutex.unlock(); db_mutex.unlock();
Error("Can't run query: %s", mysql_error(&dbconn));
continue; continue;
} }
MYSQL_RES *result = mysql_store_result(&dbconn); MYSQL_RES *result = mysql_store_result(&dbconn);
if ( !result ) { if ( !result ) {
Error("Can't use query result: %s", mysql_error(&dbconn));
db_mutex.unlock(); db_mutex.unlock();
Error("Can't use query result: %s", mysql_error(&dbconn));
continue; continue;
} }
db_mutex.unlock(); db_mutex.unlock();