Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

**Fixes**:

- Reset client report counters during initialization ([#1632](https://github.com/getsentry/sentry-native/pull/1632))
- macOS: cache VM regions for FP validation in the new unwinder. ([#1634](https://github.com/getsentry/sentry-native/pull/1634))

## 0.13.6
Expand Down
10 changes: 10 additions & 0 deletions src/sentry_client_report.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@ sentry__client_report_restore(sentry_client_report_t *report)
}
memset(report, 0, sizeof(*report));
}

void
sentry__client_report_reset(void)
{
for (int r = 0; r < SENTRY_DISCARD_REASON_MAX; r++) {
for (int c = 0; c < SENTRY_DATA_CATEGORY_MAX; c++) {
sentry__atomic_store((long *)&g_discard_counts[r][c], 0);
}
}
}
7 changes: 7 additions & 0 deletions src/sentry_client_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@ bool sentry__client_report_save(sentry_client_report_t *report);
*/
void sentry__client_report_restore(sentry_client_report_t *report);

/**
* Reset all pending discard counters to zero.
* Called during sentry_init() so that stale counts from a previous session
* do not leak into the new one.
*/
void sentry__client_report_reset(void);

#endif
2 changes: 2 additions & 0 deletions src/sentry_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ sentry_init(sentry_options_t *options)

sentry_close();

sentry__client_report_reset();

sentry_logger_t logger = { NULL, NULL, SENTRY_LEVEL_DEBUG };

if (options->debug) {
Expand Down
Loading