mirror of
https://github.com/Motion-Project/motion.git
synced 2026-04-30 19:05:58 -04:00
Revise watchdog
This commit is contained in:
@@ -736,36 +736,15 @@ static int mlp_init(struct ctx_cam *cam)
|
||||
/** clean up all memory etc. from motion init */
|
||||
void mlp_cleanup(struct ctx_cam *cam)
|
||||
{
|
||||
/* When the watchdog counter is less than zero we
|
||||
* only do the minimal necessary to free the memory variables
|
||||
* rather than finish off any event processing
|
||||
*/
|
||||
if (cam->watchdog > 0) {
|
||||
event(cam, EVENT_TLAPSE_END, NULL, NULL, NULL, NULL);
|
||||
if (cam->event_nr == cam->prev_event) {
|
||||
mlp_ring_process(cam);
|
||||
if (cam->imgs.image_preview.diffs) {
|
||||
event(cam, EVENT_IMAGE_PREVIEW, NULL, NULL, NULL, &cam->current_image->imgts);
|
||||
cam->imgs.image_preview.diffs = 0;
|
||||
}
|
||||
|
||||
event(cam, EVENT_END, NULL, NULL, NULL, &cam->current_image->imgts);
|
||||
dbse_exec(cam, NULL, 0, &cam->current_image->imgts, "event_end");
|
||||
|
||||
}
|
||||
} else {
|
||||
movie_free(cam->movie_norm);
|
||||
cam->movie_norm = NULL;
|
||||
|
||||
movie_free(cam->movie_motion);
|
||||
cam->movie_motion = NULL;
|
||||
|
||||
movie_free(cam->movie_timelapse);
|
||||
cam->movie_timelapse = NULL;
|
||||
|
||||
if (cam->dbsemp != NULL) {
|
||||
cam->dbsemp->database_sqlite3 = NULL;
|
||||
event(cam, EVENT_TLAPSE_END, NULL, NULL, NULL, NULL);
|
||||
if (cam->event_nr == cam->prev_event) {
|
||||
mlp_ring_process(cam);
|
||||
if (cam->imgs.image_preview.diffs) {
|
||||
event(cam, EVENT_IMAGE_PREVIEW, NULL, NULL, NULL, &cam->current_image->imgts);
|
||||
cam->imgs.image_preview.diffs = 0;
|
||||
}
|
||||
event(cam, EVENT_END, NULL, NULL, NULL, &cam->current_image->imgts);
|
||||
dbse_exec(cam, NULL, 0, &cam->current_image->imgts, "event_end");
|
||||
}
|
||||
|
||||
webu_stream_deinit(cam);
|
||||
|
||||
Reference in New Issue
Block a user