Show More
@@ -85,10 +85,14 b' impl PySharedState {' | |||||
85 | /// It's unsafe to update the reference count without knowing the |
|
85 | /// It's unsafe to update the reference count without knowing the | |
86 | /// reference is deleted. Do not call this function directly. |
|
86 | /// reference is deleted. Do not call this function directly. | |
87 | pub unsafe fn decrease_leak_count(&self, _py: Python, mutable: bool) { |
|
87 | pub unsafe fn decrease_leak_count(&self, _py: Python, mutable: bool) { | |
88 | self.leak_count |
|
|||
89 | .replace(self.leak_count.get().saturating_sub(1)); |
|
|||
90 | if mutable { |
|
88 | if mutable { | |
|
89 | assert_eq!(self.leak_count.get(), 0); | |||
|
90 | assert!(self.mutably_borrowed.get()); | |||
91 | self.mutably_borrowed.replace(false); |
|
91 | self.mutably_borrowed.replace(false); | |
|
92 | } else { | |||
|
93 | let count = self.leak_count.get(); | |||
|
94 | assert!(count > 0); | |||
|
95 | self.leak_count.replace(count - 1); | |||
92 | } |
|
96 | } | |
93 | } |
|
97 | } | |
94 | } |
|
98 | } |
General Comments 0
You need to be logged in to leave comments.
Login now