You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I've discovered a bug in CDictionary. When you use the Reset Method it deletes the CList object in m_data. Subsequent calls to other methods that fetch the point from the dictionary receive a bad pointer in return. Example:
I would propose the following fix for all methods which use the key hash to access a CList object from the m_data array.
Thanks nicoli shen. Your solution is the 'safer' one. However, I cannot reproduce the issue.
Another thing that bothers me related to this: an object pointer should be able to accept a null value. m_data is a dynamic array, so it should return null when an unfilled index from the array is retrieved, or the item stored is deleted. Storing data from m_data to CList* without checking the pointer beforehand is also done on other methods like Get() and Delete(), so the test scripts above should also fail if this issue exists. A simple assignment between one pointer and another can be done without any pointer access errors, even if the object the lvalue points to is already deleted:
The issue can be reduced to the example above. But in this case, there are no pointer errors. I am curious because I remember encountering this same problem in an earlier build, which was quickly patched.
I am currently using MT5 build 1932, but let me know if I am missing something.
I have these error:
'Key' - unexpected token, probably type is missing? Dictionary.mqh 39 23
'Key' - function already defined and has different type Dictionary.mqh 39 23
see declaration of 'CDictionaryEntryBase::Key' Dictionary.mqh 20 22
trying to complie on build 3320
I have these error:
'Key' - unexpected token, probably type is missing? Dictionary.mqh 39 23
'Key' - function already defined and has different type Dictionary.mqh 39 23
see declaration of 'CDictionaryEntryBase::Key' Dictionary.mqh 20 22
trying to complie on build 3320