init soap to null in constructor. Stop analysis thread before destroying soap.

This commit is contained in:
Isaac Connor 2022-01-08 12:21:29 -05:00
parent c8bc0661b1
commit dc975daa7a
2 changed files with 19 additions and 20 deletions

View File

@ -423,7 +423,8 @@ Monitor::Monitor()
green_val(0),
blue_val(0),
grayscale_val(0),
colour_val(0)
colour_val(0),
soap(nullptr)
{
if ( strcmp(config.event_close_mode, "time") == 0 )
@ -1808,8 +1809,6 @@ bool Monitor::Poll() {
return TRUE;
} //end Poll
// Would be nice if this JUST did analysis
// This idea is that we should be analysing as close to the capture frame as possible.
// This function should process as much as possible before returning
@ -3158,13 +3157,16 @@ int Monitor::Close() {
if (decoder) {
decoder->Stop();
}
if (analysis_thread) {
analysis_thread->Stop();
}
#ifdef WITH_GSOAP
//ONVIF Teardown
if (Poller) {
Poller->Stop();
}
if (onvif_event_listener && soap != nullptr) {
if (onvif_event_listener && (soap != nullptr)) {
Debug(1, "Tearing Down Onvif");
_wsnt__Unsubscribe wsnt__Unsubscribe;
_wsnt__UnsubscribeResponse wsnt__UnsubscribeResponse;
@ -3173,12 +3175,9 @@ int Monitor::Close() {
soap_end(soap);
soap_free(soap);
soap = nullptr;
}//End ONVIF
} //End ONVIF
#endif
if (analysis_thread) {
analysis_thread->Stop();
}
packetqueue.clear();
if (audio_fifo) {
delete audio_fifo;

View File

@ -256,18 +256,6 @@ protected:
protected:
//ONVIF
#ifdef WITH_GSOAP
struct soap *soap;
bool ONVIF_Trigger_State;
bool ONVIF_Healthy;
_tev__CreatePullPointSubscription request;
_tev__CreatePullPointSubscriptionResponse response;
_tev__PullMessages tev__PullMessages;
_tev__PullMessagesResponse tev__PullMessagesResponse;
PullPointSubscriptionBindingProxy proxyEvent;
void set_credentials(struct soap *soap);
#endif
// These are read from the DB and thereafter remain unchanged
unsigned int id;
@ -451,6 +439,18 @@ protected:
Rgb colour_val; /* RGB32 color */
int usedsubpixorder;
//ONVIF
#ifdef WITH_GSOAP
struct soap *soap;
bool ONVIF_Trigger_State;
bool ONVIF_Healthy;
_tev__CreatePullPointSubscription request;
_tev__CreatePullPointSubscriptionResponse response;
_tev__PullMessages tev__PullMessages;
_tev__PullMessagesResponse tev__PullMessagesResponse;
PullPointSubscriptionBindingProxy proxyEvent;
void set_credentials(struct soap *soap);
#endif
public:
explicit Monitor();