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

Severe Memory leak #403

Closed
Humrn opened this issue Aug 6, 2019 · 3 comments
Closed

Severe Memory leak #403

Humrn opened this issue Aug 6, 2019 · 3 comments

Comments

@Humrn
Copy link

Humrn commented Aug 6, 2019

I used it into my MFC project.But I found a lot of memory leaks when I stopped running the program.And I Only create a xlnt::workbook instance in my project without other operation(no load、no save 、 no read and no write operation).

@tfussell
Copy link
Owner

tfussell commented Sep 3, 2019

This sounds strange. xlnt should generally only use memory linear with the number of cells plus some base level of storage for shared objects like styles. Would you be able to use valgrind or something to find where the leak is? I've never really used MFC, but if you could create a minimal reproduction of this issue that would also be helpful.

@aewa-tech
Copy link

I had the same problem. I found 2 errors:

1 - In stylesheet.hpp, create_builtin_style function, names pointer is not deleted.
Solution:
Remove static from line
const auto *names = new std::unordered_map<std::size_t, std::string>

and delete names before exiting function.
delete names;
return new_style;

2 - In number_formats.cpp, in builtin_formats() function, formats pointer is not deleted.
I couldn't find a solution for this yet.

@tfussell
Copy link
Owner

There have been some long-standing performance issues with xlnt. I'm going to close all of the old issues in favor of a new umbrella issue #648 where we can discuss options to fix it.

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

No branches or pull requests

3 participants