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

remove unneeded string duplication and fix memory leak #133

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

r10s
Copy link
Member

@r10s r10s commented Jun 6, 2019

i think the $crate::dc_tools::dc_strdup() is not needed for passing strings to the ffi-callback function. the ffi-callback function must treat these strings are being const and must not not free() them. if the ffi-callbacks need the strings longer (eg. for queing), they must do a copy.

not totally sure, however, to_ptr() should do the job here as the return value is probably valid as long as the cstring-object exists - and this is a bit longer as the call to the ffi-callback function.

@dignifiedquire
Copy link
Member

@ralphtheninja can you run this through the node/desktop tests and try it out, just want to be sure there are no surprises

@ralphtheninja
Copy link
Member

@dignifiedquire Works fine!

What happened on AppVeyor there though?

@dignifiedquire
Copy link
Member

Unrelated, there was a brief period where the rand package was broken.

@dignifiedquire dignifiedquire merged commit f5683f1 into master Jun 7, 2019
@dignifiedquire dignifiedquire deleted the fix-log-memory-leak branch June 7, 2019 11:34
jptyrkko pushed a commit to open-xchange/deltachat-core-rust that referenced this pull request Aug 19, 2019
This update addresses the tickets deltachat#133 and deltachat#134.

The mode of the program is now controlled by a new configuration parameter ChatMode, whose value "off" forces the program to use the "Gr." legacy prefix, and "on", which outputs the "chat$group." prefix. For reading the header both prefixes are recognized and accepted.

Function dc_create_outgoing_rfc724_mid has now a new parameter "context" to allow reading the configuration within the function.

The new convention has been reflected on the tests at the end of dc_tools.rs.

In the source the modified code sections are marked by the date and the committer name "Juha-Petri Tyrkkö".
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.

3 participants