Uh oh!
There was an error while loading. Please reload this page.
fix: call base basic finalizer if none defined - #1574
Conversation
| #endif | ||
| instance->Finalize(Napi::BasicEnv(env)); | ||
| } else { |
There was a problem hiding this comment.
I see how this fixes the existing, not used error, but does it also fix running some finalization that should have run before but would not have, or now call the method just to fix the not used error?
There was a problem hiding this comment.
but does it also fix running some finalization that should have run before but would not have
This is not the case. If the user defined their own MyClass::Finalize(BasicEnv), the constexpr (details::HasBasicFinalizer<T>::value) would be true, and then call instance->Finalize(Napi::BasicEnv(env)).
... now call the method just to fix the not used error
This is the case, so it is adding an inefficiency (perhaps the compiler optimizes it out)
There was a problem hiding this comment.
My questions is to make sure the additional invocation is desired, if so good, sounds like we found a potential bug as well. If not I think we can just add a (void) env; early in the function to mark it as used to address the warning.
There was a problem hiding this comment.
I'm trying the same solution you proposed adding (void) env; on my local machine.
There was a problem hiding this comment.
it worked well on my local machine.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #1574 +/- ##
=======================================
Coverage 64.40% 64.40% =======================================
Files 3 3 Lines 2003 2003 Branches 693 693 =======================================
Hits 1290 1290 Misses 146 146 Partials 567 567 ☔ View full report in Codecov by Sentry. |
I've started a single Jenkins v22 run to see if the fix works
|
The CI fail, but it seems to be systemec failure: I try to launch new job. |
The CI is green now I try to launch it for all LTS and CI: |
mhdawson
commented
Sep 5, 2024
Looks like CIs are good. @NickNaso thanks for kicking those off and checking the solution. Going to land. |
mhdawson
commented
Sep 5, 2024
Will check the regular node-addon ci tomorrow to confirm all locks good. @KevinEady, @NickNaso thanks for the quick work to get this addressed. |
Call no-op
ObjectWrap<T>::Finalizeif user does not provide aFinalizermethod.Fixes: #1573