mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-24 10:20:24 +01:00
Check if baton FuncRef is valid before calling call_funcv()
Often when closing a terminal in the terminal panel the error message 'Condition "!obj" is true.' would be printed to console. This was due to the call_funcv() method being called on an invalid FuncRef instance (invalid because it had already been deleted or queued for delection). Now we check the instance is valid before calling the method.
This commit is contained in:
parent
ef9e96ed13
commit
001a9525d1
2 changed files with 4 additions and 3 deletions
|
@ -25,7 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Fixed
|
||||
- The `kill()` method of unix PTY node can now be called without error as the underlying
|
||||
`pipe.close()` method of the gdnative library is now registered.
|
||||
|
||||
- Fixed 'Condition "!obj" is true.' error that would often print to console when
|
||||
closing terminals in the Terminal panel of the editor plugin.
|
||||
|
||||
|
||||
## [v2.0.0](https://github.com/lihop/godot-xterm/compare/v1.2.1...v2.0.0) - 2021-07-25
|
||||
|
|
|
@ -445,8 +445,8 @@ static void pty_after_waitpid(uv_async_t *async) {
|
|||
|
||||
Array argv = Array::make(baton->exit_code, baton->signal_code);
|
||||
|
||||
ERR_FAIL_COND(baton->cb == nullptr);
|
||||
baton->cb->call_funcv(argv);
|
||||
if (baton->cb != nullptr && baton->cb->is_valid())
|
||||
baton->cb->call_funcv(argv);
|
||||
|
||||
uv_close((uv_handle_t *)async, pty_after_close);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue