Raised This Month: $ Target: $400
 0% 

Dynamic Objects and Properties - v.0.0.32 - [2018.05.08]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 12-20-2016 , 17:20   Re: Dynamic Objects and Properties - v.0.0.22 - [2016.11.21]
Reply With Quote #1

Thanks a bunch!!!
__________________
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 12-29-2016 , 22:32   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #2

Version 0.0.23 Released

- Small fixes to compile on 1.9
- Allow sm_dynamic_selftest from the server console
- Implement Handle Usage Report
- Collection Leak Fix

A big thanks to dubbeh for their testing and merge requests!

IMPORTANT INFO BELOW

If you have a plugin that uses the Dynamic Collection methodmap, you need to update the include files and recompile the plugin to fix leaks in the Collection.Dispose method!
__________________

Last edited by Neuro Toxin; 12-29-2016 at 22:34.
Neuro Toxin is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 01-04-2017 , 22:27   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #3

Hey. Since I'm dealing with a fixed ammount of clients (maximum of 64) I declared a global Donor array like this
PHP Code:
Donor donorArray[MAXPLAYERS 1]; 
Everything was working fine until I noticed that when I try and clear client information when they disconnect I get a warning where I set it equal to INVALID_DYNAMIC_OBJECT

PHP Code:
public void OnClientDisconnect(int client)
{
    
donorArray[client].Dispose();
    
donorArray[client] = INVALID_DYNAMIC_OBJECT// line 57

Code:
SourcePawn Compiler 1.8.0.5967
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2015 AlliedModders LLC

C:\Users\Michael\Desktop\Donation Plugin\hl_donations.sp(57) : warning 213: tag mismatch
Code size:             9060 bytes
Data size:             5556 bytes
Stack/heap size:      16384 bytes
Total requirements:   31000 bytes
Here's my methodmap if you need it

Spoiler


What exactly am I doing wrong here? Do I need to set it back to INVALID_DYNAMIC_OBJECT?

Last edited by headline; 01-04-2017 at 22:28.
headline is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-04-2017 , 22:37   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #4

Just call .Dispose()

If u need to determine if a dynamic object is valid check the .IsValid property.

This will return false if the object is disposed.

Edit:

This will remove the warning.

Code:
donorArray[client] = view_as<Donor>(INVALID_DYNAMIC_OBJECT);
__________________

Last edited by Neuro Toxin; 01-05-2017 at 04:11.
Neuro Toxin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-17-2017 , 16:00   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #5

Fixed a bug in the ClassBuilder where offsets had still been declared as ints generating type mismatch errors (thanks Pelipoika)

Spoiler
__________________
Neuro Toxin is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 01-19-2017 , 22:24   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #6

Code:
L 01/19/2017 - 21:09:15: [SM] Exception reported: Could not read Handle c0bf03e9 (error 1)
L 01/19/2017 - 21:09:15: [SM] Blaming: dynamic.smx
L 01/19/2017 - 21:09:15: [SM] Call stack trace:
L 01/19/2017 - 21:09:15: [SM]   [0] GetPluginStatus
L 01/19/2017 - 21:09:15: [SM]   [1] Line 246, \\MPLFILER\HomeDirs\m19214\Desktop\spedit1.1.3.0\sourcepawn\configs\sm_1_8_5914\dynamic.sp::_Dynamic_CollectGarbage
L 01/19/2017 - 21:09:15: [SM]   [2] Line 119, \\MPLFILER\HomeDirs\m19214\Desktop\spedit1.1.3.0\sourcepawn\configs\sm_1_8_5914\dynamic.sp::OnMapStart
Not exactly sure what's causing this...
https://github.com/Headline22/Weapon-Spawner
headline is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-20-2017 , 02:18   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #7

https://github.com/ntoxin66/Dynamic/...ynamic.sp#L246

Are you unloading / loading your plugin during a map then letting the server change map?
__________________
Neuro Toxin is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 01-20-2017 , 02:36   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #8

Quote:
Originally Posted by Neuro Toxin View Post
https://github.com/ntoxin66/Dynamic/...ynamic.sp#L246

Are you unloading / loading your plugin during a map then letting the server change map?
I am reloading the plugin and then just changing the map, yes.

Last edited by headline; 01-20-2017 at 02:36.
headline is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-20-2017 , 07:36   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #9

Registering a library for your plugin will allow Dynamic to correctly dispose of your plugins objects when it unloads.

You could also .Dispose your Dynamic objects OnPluginEnd to avoid this error in the garbage collector.
__________________

Last edited by Neuro Toxin; 01-20-2017 at 07:37.
Neuro Toxin is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-21-2017 , 06:32   Re: Dynamic Objects and Properties - v.0.0.23 - [2016.12.30]
Reply With Quote #10

Quote:
Originally Posted by Neuro Toxin View Post
You could also .Dispose your Dynamic objects OnPluginEnd
This is the sane and correct thing to do, and why OnPluginEnd exists.
__________________
asherkin 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 12:43.


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