Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #7

Merged
merged 5 commits into from
Jul 9, 2024
Merged

Fixes #7

merged 5 commits into from
Jul 9, 2024

Conversation

Tasssadar
Copy link
Contributor

No description provided.

Comment on lines +270 to +275
~MotorFeature() {
for(auto& motor : _motors) {
auto& jsdcMotor = *MotorProtoBuilder<MotorFeature<Next>>::getOpaque(this->context(), motor);
jsdcMotor.clear();
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pendingPromise is not freed BEFORE JS_FreeRuntime, quickjs goes into assert thinking there is a memory leak. It would actually free the promises later, but during the leak check, references from imported modules are still alive, so the leak check happens before the export const reference on motor is freed and before JSDCMotor finalizer is called.

So it's the leak check being wrong, but it means it crashes program during uploading if you use motors but don't resolve the promise.

@cubicap cubicap merged commit 2364688 into cubicap:master Jul 9, 2024
3 checks passed
@Tasssadar Tasssadar deleted the fixes branch July 9, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants