Closed yerden closed 6 years ago
Hi, Nil constant is defined in RespBytes.mqh, it's a singleton that are used to encode NULLs to RESP format. If you clear RespArray it also delete this NULLs encoder through SafeDelete()
, and on next time, we got Bad Pointer crash in MT
Oh, I see, my bad.
Then, I guess, we have a dependency issue here. RespArray.mqh
doesn't #include
RespBytes.mqh
. Everybody who uses RespArray should include RespBytes.mqh from now on.
Or we can include it right in RespArray.mqh
?
Exactly, probably need to include RespBytes.mqh
to RespArray.mqh
or change include order in Resp.mqh
or move Nil definition to RespArray.mqh
. I'm not so strong in mql, and any advise will be helpful from you guys.
Sorry that I've broke the build :smile:
As stated in README: "To use the RESP protocol, you need to include Mql/Format/Resp.mqh". Looks like now the build is ok, it was my #include
mistake.
@yerden @marfer Thanks for discussing the issue and it is necessary to clarify things and expose problems. Though including Resp.mqh directly does not break the build but I think it is a good practice to include RespBytes.mqh in RespArray.mqh as the Nil entity is referenced. I will make the change.
Issues with pull request #27:
Nil
constant is unknown;SafeDelete()
checks the pointer byCheckPointer()
and does nothing with NULL pointer.@dingmaotu: please check the build is ok before accepting pulls.