On May 28, 7:30 pm, Erik Wikstr=F6m <eri...@student.chalmers.se> wrote:
On 28 Maj, 16:25, "John" <prakash.mi...@gmail.com> wrote:
Hello,
is there any compiler option for g++ for initializing static members =
not getting initialized properly.
Most probable reason for this is that you do not initialize it in the
code, but you have not shown us any code so we can't tell.
--
Erik Wikstr=F6m
FYI
Here is the code:
Application is using below mentioned template class which is declared
as static in RuleEngine.h class file.
static RWTPtrHashDictionary<RWCString, RuleClass
RWDefHArgs(RWCString)>ruleHash;
RWTPtrHashDictionary<RWCString, RuleClass RWDefHArgs(RWCString)>
RuleEngine::ruleHash(RWCString::hash);
Above line definition/initialization for ruleHash is found in
RuleEngine.C at the beginning of the file.
Here is sample piece of code where ruleHash is used. This code is
RuleEngine.C. I am calling insertRule(this) static method from
RuleClass.h class file.
Void RuleEngine::insertRule( RuleClass* newRule )
{
RuleClass* rule = NULL;
if( 0 != ruleHash.entries() )
............
Core dump....
}
Application is using template object ruleHash to call entries()
method.
I am getting core dump at releHash.entries() line. Its not only with
entries method, it crashes for any methods of RWTPtrHashDictionary.
I have also tried with other template class RWTValDlist<RWCString> to
test whether it is problem with deprecated RWTPtrHashDictionary
template.
But I see that application crashes for RWTValDlist template too.
Please help me.
Thanks,
Prakash
RuleEngine::ruleHash(and result is unpredictable)...