Raised This Month: $51 Target: $400
 12% 

Invalid handle error even with checking if it is not null


Post New Thread Reply   
 
Thread Tools Display Modes
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 08-22-2018 , 11:53   Re: Invalid handle error even with checking if it is not null
Reply With Quote #11

Probably last thing i want to ask, to be 100% sure. Below code should be fine?
PHP Code:
ArrayList a = new ArrayList(32);
ArrayList b a;              // or should i clone it and then just delete like variable a: ArrayList b = a.Clone()?
...
null;
delete a
hh2 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-22-2018 , 15:07   Re: Invalid handle error even with checking if it is not null
Reply With Quote #12

That snippet is fine if you want a and b to both be freed and the variables to be null at the same time.

Whether you want to ArrayList.Clone it (or CloneHandle, which isn't the same thing) depends on what you want the lifetime of the handle(s) to be.

Last edited by Fyren; 08-22-2018 at 15:07.
Fyren is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode