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

Fix memory leaks #17035

Merged
merged 1 commit into from
Mar 3, 2018
Merged

Fix memory leaks #17035

merged 1 commit into from
Mar 3, 2018

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Feb 26, 2018

Closes #17033, #17032, #17031, thanks @fangang190

Im not sure about right way to fix for #17030, cuz im not an expert in android apk, and calling zipClose(unaligned_apk, NULL); before return may cause errors, so anybody with free time and knowledge could fix it instead

@27thLiz 27thLiz added this to the 3.1 milestone Feb 26, 2018
@ghost
Copy link

ghost commented Feb 26, 2018

Thirdparty bugfix should contain comment // -- GODOT start -- and // -- GODOT end --, a .patch of the change, and the following comment to thirdparty/README.md:

Important: Some files have Godot-made changes. They are marked with // -- GODOT start -- 
and // -- GODOT end -- comments and a patch is provided in the [thirdparty_module]/ folder.

@Chaosus Chaosus force-pushed the fixleaks branch 3 times, most recently from f265a31 to 78223c8 Compare February 26, 2018 11:10
@ghost ghost requested a review from akien-mga February 26, 2018 12:34
@Chaosus
Copy link
Member Author

Chaosus commented Mar 2, 2018

Done.. waiting for merge..

@27thLiz
Copy link
Contributor

27thLiz commented Mar 2, 2018

Did you forget to git add the patches by any chance? They seem to be missing ^^

@Chaosus
Copy link
Member Author

Chaosus commented Mar 2, 2018

I dont understand you, I just use the commit and then rebase with squash.. and it was enough in most cases

@27thLiz
Copy link
Contributor

27thLiz commented Mar 2, 2018

Well, what I mean is that you mention the patches in the readme:

Important: Some files have Godot-made changes.
They are marked with // -- GODOT start -- and // -- GODOT end --
comments and a patch is provided in the b2d_convexdecomp/ folder.

But there are no *.patch files in your commit.

@Chaosus
Copy link
Member Author

Chaosus commented Mar 3, 2018

@Hinsbart Ok, I change it to just

"Important: Some files have Godot-made changes.
They are marked with // -- GODOT start -- and // -- GODOT end --
comments."

@@ -1284,7 +1284,9 @@ long Segment::DoLoadCluster(long long& pos, long& len) {
pos += cluster_size;

m_pos = pos;

// -- GODOT start --
delete pCluster;
Copy link
Member

Choose a reason for hiding this comment

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

Won't pCluster leak on line 1297 too if we don't enter this if?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, it's assigned to m_pUnknownSize and should not be freed.

Copy link
Member Author

@Chaosus Chaosus Mar 3, 2018

Choose a reason for hiding this comment

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

Yeah, I saw it too and didnt decide to delete

@akien-mga akien-mga merged commit cbb4fe4 into godotengine:master Mar 3, 2018
@akien-mga
Copy link
Member

Thanks! Would you mind contributing those fixes upstream too, so that we can drop our custom modification next time we sync with them?

@Chaosus
Copy link
Member Author

Chaosus commented Mar 3, 2018

Okay ) I take a look on it

@Chaosus
Copy link
Member Author

Chaosus commented Sep 16, 2018

@akien-mga Seems like erincato merged my PR to b2Polygon - erincatto/box2d#486,
I think the part of this PR should be reverted and b2Polygon should be updated

@akien-mga
Copy link
Member

Thanks for the notice. It looks like we already had quite a few changes compared to the upstream code (diff when trying to replace our files by upstream ones: https://paste.fedoraproject.org/paste/-5ujnPQIUTZFZI8IjhhB2A), so I guess it's good to keep as is.

Some of our changes shown in the diff are cosmetic and could be pushed upstream, but others are specific to Godot (like removing the dependency on Box2D's glue and using some Godot constants like CMP_EPSILON, or adding a namespace and removing debug spam).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Leak in [mkvparser.cc:1283]
3 participants