Skip to content

Commit

Permalink
allow returns from compile_string
Browse files Browse the repository at this point in the history
  • Loading branch information
catornot committed Aug 30, 2024
1 parent b76bf68 commit a7616e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/high/squirrel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ pub fn compile_string(
if result != SQRESULT::SQRESULT_ERROR {
(sqfunctions.sq_pushroottable)(sqvm.as_ptr());

if (sqfunctions.sq_call)(sqvm.as_ptr(), 1, 0, 0) == SQRESULT::SQRESULT_ERROR {
if (sqfunctions.sq_call)(sqvm.as_ptr(), 1, 1, 1) == SQRESULT::SQRESULT_ERROR {
Err(SQCompileError::BufferFailedToExecute)
} else {
Ok(())
Expand Down
1 change: 1 addition & 0 deletions src/macros/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ macro_rules! entry {
.expect("sqvm should not be null on sqvm destroy");
let handle = high::squirrel::CSquirrelVMHandle::new(sqvm, context, true, token);
PLUGIN.wait().on_sqvm_destroyed(&handle, token);
unsafe { $crate::high::engine_sync::run_async_routine() }; // run all possible stuff to not leak into next sqvm
}
fn OnLibraryLoaded(
&self,
Expand Down

0 comments on commit a7616e8

Please sign in to comment.