Skip to content

Commit

Permalink
clean up last sample cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylphrex committed Jan 5, 2023
1 parent f6565fe commit 76948e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sentry_sdk/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,9 @@ def _sample_stack(*args, **kwargs):
"""
# no profiles taking place, so we can stop early
if not self.new_profiles and not self.active_profiles:
# make sure to clear the cache if we're not profiling so we dont
# keep a reference to the last stack of frames around
last_sample[0] = {}
return

# This is the number of profiles we want to pop off.
Expand Down

0 comments on commit 76948e7

Please sign in to comment.