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

memory leak at glslOutput.cpp #58

Open
crazii opened this issue Mar 22, 2015 · 2 comments
Open

memory leak at glslOutput.cpp #58

crazii opened this issue Mar 22, 2015 · 2 comments

Comments

@crazii
Copy link

crazii commented Mar 22, 2015

hlslang\GLSLCodeGen\glslOutput.cpp : 1867

probable/quick fix:

     StructMember m = StructMember( it->type->getFieldName().c_str(),
                                        (it->type->hasSemantic()) ? it->type->getSemantic().c_str() : "",
                                         translateType(it->type),
                                         structQual,
                                         prec,
                                         it->type->isArray() ? it->type->getArraySize() : 0,
                                        (it->type->getBasicType() == EbtStruct) ? createStructFromType(it->type) : NULL,
                                         structName);
     s->addMember(m);
@mingwandroid
Copy link
Contributor

hlsl2glslfork is one of the most leaky pieces of software I've ever encountered. It's only cleanup method is to pull down the internal memory pools. This was a conscious, only partly implemented design decision (partly implemented because I don't believe you can recover from that pull down and translate more shaders afterwards - I'd be happy to be proved wrong on that).

It would be foolhardy to try to fix the leaks. I did it some time ago and can refresh the patches if you wish, but it's neither pretty nor complete. IMHO - without wishing to cause offence to @aras-p who maintains it and isn't responsible for the original design - this software is something of a train wreck.

@crazii
Copy link
Author

crazii commented Mar 24, 2015

@mingwandroid yes, maybe you're right.my idea is quite simple: this library is useful and try making it better.
Even for an offline tool, memory leak can cause work suspended. For me hlsl2glsl/glsl_optimizer is integrated in visual studio. And I encountered its 'OUT OF MEMORY' random crash when performing parallel build with other compiling/building tasks.

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

No branches or pull requests

2 participants