diff options
| author | 2022-04-06 17:41:11 -0700 | |
|---|---|---|
| committer | 2022-04-08 14:11:40 -0700 | |
| commit | 788bebb160e0f6002a225eac365252a493a92f77 (patch) | |
| tree | aece2571b09bf61c05388508b59dcaf2ed846c8f /src | |
| parent | hle: service: sm: Remove manual tracking of KServerPorts. (diff) | |
| download | yuzu-788bebb160e0f6002a225eac365252a493a92f77.tar.gz yuzu-788bebb160e0f6002a225eac365252a493a92f77.tar.xz yuzu-788bebb160e0f6002a225eac365252a493a92f77.zip | |
hle: kernel: k_auto_object: Move unregister with kernel to after Destroy.
- Destructor is no longer invoked, so our object counting was off.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/k_auto_object.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/hle/kernel/k_auto_object.h b/src/core/hle/kernel/k_auto_object.h index 05779f2d5..c097373a8 100644 --- a/src/core/hle/kernel/k_auto_object.h +++ b/src/core/hle/kernel/k_auto_object.h | |||
| @@ -89,9 +89,7 @@ public: | |||
| 89 | explicit KAutoObject(KernelCore& kernel_) : kernel(kernel_) { | 89 | explicit KAutoObject(KernelCore& kernel_) : kernel(kernel_) { |
| 90 | RegisterWithKernel(); | 90 | RegisterWithKernel(); |
| 91 | } | 91 | } |
| 92 | virtual ~KAutoObject() { | 92 | virtual ~KAutoObject() = default; |
| 93 | UnregisterWithKernel(); | ||
| 94 | } | ||
| 95 | 93 | ||
| 96 | static KAutoObject* Create(KAutoObject* ptr); | 94 | static KAutoObject* Create(KAutoObject* ptr); |
| 97 | 95 | ||
| @@ -168,6 +166,7 @@ public: | |||
| 168 | // If ref count hits zero, destroy the object. | 166 | // If ref count hits zero, destroy the object. |
| 169 | if (cur_ref_count - 1 == 0) { | 167 | if (cur_ref_count - 1 == 0) { |
| 170 | this->Destroy(); | 168 | this->Destroy(); |
| 169 | this->UnregisterWithKernel(); | ||
| 171 | } | 170 | } |
| 172 | } | 171 | } |
| 173 | 172 | ||