Vladimir Simakov: You have to create a temporary object on the stack in this case)))
CSomeObj(<params>).SomeMethod()
this is my first example, I create JSONParser in local scope there, it will be deleted when I exit the function
The question is, basically, that such things as an example #2 Sharp will swallow, and here I still need to think... in general Sharp is more succinct than Pros!!! - so for a cholivar! )))
this is my first example, I create JSONParser in local scope there, it will be deleted when I exit the function
the question is, in principle, that such things as an example number 2 Sharpe will swallow, and here you still need to think ... in general Sharp is more succinct than Pros!!! - so for a cholivar! )))
You create a pointer to an object in a local area, but the object itself is in the heap and that's what leaks).
It's not a Sharp, the rubbish collector is missing)))
I don't understand the behaviour of pointers in MQL anyway, this code works without any problems and will delete all dynamically created objects at the end of the script:
I don't understand the behaviour of pointers in MQL anyway, this code works without any problems and will delete all dynamically created objects at the end of the script:
why does it work? i just deleted JSONParser *parser object, so it should get all pointers as NULL
why ?
Again, this isn't Sharp, there's no such thing as "linked references"... The object lives until the programmer personally kills it, regardless of references.
again this isn't sharpe, there's no such thing as "linked references"... The object lives until the programmer kills it personally, regardless of references.
Well, that's the question, we have a workable variant of the code, but the pointers' behavior is unclear to me
In theory, variant 2 from the first message should work
It's hilarious for users who get into discussions about "high" when in practice they can't put 1+1 together. I wonder if the Dunning-Krueger effect is stinging anywhere?
I have some misunderstanding with pointers in MQL5 - a very "unspecified thing".
I ran into a problem with a test script (I have the library attached):
this code will delete the pointer, everything is OK.
I wanted to write it this way at first:
when running the script, I get: 1 object of type JSONParser left
so how do i remove this JSONParser outside of the function ?
I have some misunderstanding with pointers in MQL5 - a very "unspecified thing".
I ran into a problem with a test script (I have attached the library):
this code will delete the pointer, everything is OK.
I wanted to write it this way at first:
when running the script, I get: 1 object of type JSONParser left
so how do i remove this JSONParser outside of the function ?
You have to create a temporary object on the stack in this case)))
this is my first example, I create JSONParser in local scope there, it will be deleted when I exit the function
The question is, basically, that such things as an example #2 Sharp will swallow, and here I still need to think... in general Sharp is more succinct than Pros!!! - so for a cholivar! )))
this is my first example, I create JSONParser in local scope there, it will be deleted when I exit the function
the question is, in principle, that such things as an example number 2 Sharpe will swallow, and here you still need to think ... in general Sharp is more succinct than Pros!!! - so for a cholivar! )))
You create a pointer to an object in a local area and the object itself is in a heap and it's the object that leaks).
I told you Sharpe rules! )))
Nn, in general, the first option I will use and will not bother the brain, thank you for participating!
I don't understand the behaviour of pointers in MQL anyway, this code works without any problems and will delete all dynamically created objects at the end of the script:
why does it work? i have deleted the JSONParser *parser object, so it should get all related pointers as NULL
I don't understand the behaviour of pointers in MQL anyway, this code works without any problems and will delete all dynamically created objects at the end of the script:
why does it work? i just deleted JSONParser *parser object, so it should get all pointers as NULL
why ?
Again, this isn't Sharp, there's no such thing as "linked references"... The object lives until the programmer personally kills it, regardless of references.
why would I do that?
again this isn't sharpe, there's no such thing as "linked references"... The object lives until the programmer kills it personally, regardless of references.
Well, that's the question, we have a workable variant of the code, but the pointers' behavior is unclear to me
In theory, variant 2 from the first message should work
I wonder if the Dunning-Krueger effect is stinging anywhere?
how cheeky I am here...
you got a knowledge discount, I didn't get a discount) even though they're all expensive