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

how can i get whether specific methodmap is cloneable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 10-05-2015 , 16:09   how can i get whether specific methodmap is cloneable
Reply With Quote #1

especially, is DBResultSet cloneable?

or are all the methodmaps and handle cloneable?
__________________

Last edited by Starbish; 10-05-2015 at 16:10.
Starbish is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 10-05-2015 , 18:00   Re: how can i get whether specific methodmap is cloneable
Reply With Quote #2

All handles should be able to be cloned by the plugin owning them(as well as be able to change ownership of the cloned handle)
WildCard65 is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 10-06-2015 , 04:44   Re: how can i get whether specific methodmap is cloneable
Reply With Quote #3

Quote:
Originally Posted by WildCard65 View Post
All handles should be able to be cloned by the plugin owning them(as well as be able to change ownership of the cloned handle)
https://wiki.alliedmods.net/Handles_...eMod_Scripting)

That seems not true
__________________
Starbish is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 10-06-2015 , 13:01   Re: how can i get whether specific methodmap is cloneable
Reply With Quote #4

Quote:
Originally Posted by Starbish View Post
According to said wiki page, it is true what I said.

A plugin owning a handle can clone it and be owner of new clone or explicitly provide the new owner of the clone
WildCard65 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-06-2015 , 13:04   Re: how can i get whether specific methodmap is cloneable
Reply With Quote #5

Usually Handles are Cloneable and Closeable unless otherwise documented.

Having said that, cloning DBResultSet strikes me as an extremely bad idea. CloneHandle makes a second copy of the Handle1, not the data.

Why is this important?

Because calling FetchMoreResults or Rewind affects the data. If you call it from either Handle, the data available to both Handles changes.

1This uses reference counting, meaning that the object referenced by the Handles isn't deleted until all Handles to it are closed.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-06-2015 at 13:04.
Powerlord is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 10-06-2015 , 13:50   Re: how can i get whether specific methodmap is cloneable
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
Usually Handles are Cloneable and Closeable unless otherwise documented.

Having said that, cloning DBResultSet strikes me as an extremely bad idea. CloneHandle makes a second copy of the Handle1, not the data.

Why is this important?

Because calling FetchMoreResults or Rewind affects the data. If you call it from either Handle, the data available to both Handles changes.

1This uses reference counting, meaning that the object referenced by the Handles isn't deleted until all Handles to it are closed.
oh, Thank you for your answering
__________________

Last edited by Starbish; 10-06-2015 at 13:50.
Starbish 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 07:37.


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