OK, but first up let us both get something sorted out.
You live in India and I live in Australia and we may misconstrue the meanings or local usage of words.
When you type “w.r.t” I understand that to mean “with reference to”
When you say “for this particular query of mine” I understand “for this particular question of mine”.
I am simply trying to be clear, because I am fundamentally lazy, and don’t wish to type the same thing twice.
“Can i have a concrete example w.r.t. VBA”
No not from me. I do not know how to write any code that would prove the necessity to deliberately de-allocate memory usage in VBA.
But I am not the smartest person on this Earth by a long shot; there is always someone smarter. You will find them on the WWW, (World Wide Wed), and their name is “Anybody Smarter”.
“so that i can safeguard myself further”
My suggestion; take control of your situation and deliberately de-allocate memory.
As for the pointer going out of scope, I am reasonably sure that the memory allocation for the “pointer” would be de-allocated but not necessarily the memory that it points too, two entirely different things.
I honestly hope this is not some hypothetical question raised by students as some sort of bet, in which case the answer will remain undefined and all bets are off.
If a teacher raised the question then that teacher would be better placed in the philosophy department and raise questions about “How many angels can fit on the head of a pin?”
My answer is, as “Anybody Smarter” would say, Just do it.
Regards,
Chris.