Postprocessing changes #201

Merged
jwharm merged 2 commits from postprocessing-changes into main 2025-03-16 16:40:01 +01:00
jwharm commented 2025-03-16 16:39:48 +01:00 (Migrated from github.com)

This PR merges a lot of the code that handles return values and out-parameters (take ownership, free native memory, check for null, etc). This code is now done in post-processing statements for both return values and out-parameters. As a result, all return values are now stored in a _returnValue variable before being returned. The post-processing statements (if any) are generated between those lines.

This not only improves the code generator internally (the MethodGenerator is now a lot simpler) but it also fixes bugs because out-parameters didn't always free native memory when they should. soup_form_decode_multipart is an example of this, that should now be fixed.

This PR merges a lot of the code that handles return values and out-parameters (take ownership, free native memory, check for null, etc). This code is now done in post-processing statements for both return values and out-parameters. As a result, all return values are now stored in a `_returnValue` variable before being returned. The post-processing statements (if any) are generated between those lines. This not only improves the code generator internally (the MethodGenerator is now a lot simpler) but it also fixes bugs because out-parameters didn't always free native memory when they should. `soup_form_decode_multipart` is an example of this, that should now be fixed.
Sign in to join this conversation.
No description provided.