Commit 31480fb
committed
Fix tcore IMF context null deref in destructor on create failure
When tizen_core_imf_context_create fails in the constructor, imf_context_
stays nullptr and the constructor returns early without registering any
callbacks. The destructor still called UnregisterInputPanelEventCallback
and UnregisterEventCallbacks unconditionally; both FT_ASSERT(imf_context_)
and then pass the null handle to tizen_core_imf_context_del_*_callback,
aborting in debug builds and dereferencing null in release builds.
Guard the unregister/destroy calls behind the imf_context_ null check so
they only run when registration actually happened, mirroring the
constructor's early return.1 parent b378d8f commit 31480fb
1 file changed
Lines changed: 2 additions & 3 deletions
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 154 | | |
| 155 | + | |
| 156 | + | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
| |||
0 commit comments