2018-12-18 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdpadengined(8) that failed to kill a pypad
	script after receiving a DELETE notification for it.
This commit is contained in:
Fred Gleason 2018-12-18 12:32:26 -05:00
parent bc42ff435c
commit f148205d10
2 changed files with 27 additions and 23 deletions

View File

@ -18214,3 +18214,6 @@
* Added a 'PYPAD_INSTANCES.EXIT_CODE' field to the database.
* Added a 'PYPAD_INSTANCES.ERROR_TEXT' field to the database.
* Incremented the database version to 304.
2018-12-18 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdpadengined(8) that failed to kill a pypad
script after receiving a DELETE notification for it.

View File

@ -145,16 +145,19 @@ void MainObject::notificationReceivedData(RDNotification *notify)
QString sql;
RDSqlQuery *q;
syslog(LOG_NOTICE,"NOTIFY: %s",(const char *)notify->write().toUtf8());
if(notify->type()==RDNotification::PypadType) {
int id=notify->id().toUInt();
switch(notify->action()) {
case RDNotification::AddAction:
sql=QString("select SCRIPT_PATH from PYPAD_INSTANCES where ")+
QString().sprintf("ID=%u && ",id)+
"STATION_NAME=\""+RDEscapeString(rda->station()->name())+"\"";
q=new RDSqlQuery(sql);
while(q->next()) {
switch(notify->action()) {
case RDNotification::AddAction:
if(q->first()) {
StartScript(id,q->value(0).toString());
}
delete q;
break;
case RDNotification::DeleteAction:
@ -171,8 +174,6 @@ void MainObject::notificationReceivedData(RDNotification *notify)
break;
}
}
delete q;
}
}