Skip to content

Commit

Permalink
_ddca_terminate(): set wait parm true on ddc_stop_watch_displays
Browse files Browse the repository at this point in the history
also:
ddca_start_capture()/ddca_end_capture():
- set global traced_function_stack_suspended
- these functions confuse the stack
  • Loading branch information
rockowitz committed Dec 31, 2024
1 parent f0b79d7 commit 554eb02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libmain/api_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ _ddca_terminate(void) {
ddc_report_stats_main(requested_stats, per_display_stats, dsa_detail_stats, false, 0);
DDCA_Display_Event_Class active_classes;
if (is_watch_displays_executing())
ddc_stop_watch_displays(/*wait=*/ false, &active_classes); // in case it was started
ddc_stop_watch_displays(/*wait=*/ true, &active_classes); // in case it was started
DBGTRC_NOPREFIX(debug, DDCA_TRC_API, "After ddc_stop_watch_displays");
// sleep(5); // still needed?
terminate_ddc_services();
Expand Down Expand Up @@ -1073,6 +1073,7 @@ ddca_set_ferr_to_default(void) {
void
ddca_start_capture(DDCA_Capture_Option_Flags flags) {
bool debug = false;
traced_function_stack_suspended = true;
DBGTRC_STARTING(debug, DDCA_TRC_API, "flags=0x%02x", flags);
msg_decoration_suspended = true;
start_capture(flags);
Expand All @@ -1086,6 +1087,7 @@ ddca_end_capture(void) {
char * result = end_capture();
msg_decoration_suspended = false;
DBGTRC_DONE(debug, DDCA_TRC_API, "Returning %p", result);
traced_function_stack_suspended = false;
return result;
}

Expand Down

0 comments on commit 554eb02

Please sign in to comment.