Raised This Month: $ Target: $400
 0% 

[AMXX] Run time error 4: index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 08-29-2016 , 13:30   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #11

EFFx no more debug log about index out of bounds thnx but there is new prob

Quote:
L 08/29/2016 - 18:26:57: [AMXX] Displaying debug trace (plugin "test3.amxx")
L 08/29/2016 - 18:26:57: [AMXX] Run time error 10: native error (native "menu_destroy")
L 08/29/2016 - 18:26:57: [AMXX] [0] test3.sma::menu_handler (line 73)
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !

Last edited by Old.School; 08-29-2016 at 13:44.
Old.School is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-29-2016 , 13:35   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #12

I think you cut off the error message. Anyway, what I think is happening is that you are destroying a menu more than once. Remove menu_destroy() from both of your cases and leave it at the end of the function.
klippy is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 08-29-2016 , 13:48   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #13

KliPPy its two bug logs thats why . and thnx for explaining
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-29-2016 , 19:08   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #14

Do what KliPPy said.

PHP Code:
public menu_handler(idmenuitem)
{
    switch( 
item )
    {
        case 
0:
        {
            
iArrestid );
            
menu_destroymenu );
        }
        case 
1:
        {
            
iUnArrestid );
            
menu_destroymenu );
        }
    }
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

->

PHP Code:
public menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    switch( 
item )
    {
        case 
0:
        {
            
iArrestid );
        }
        case 
1:
        {
            
iUnArrestid );
        }
    }
    return 
PLUGIN_HANDLED;

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 08-29-2016 at 19:08.
EFFx is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 08-29-2016 , 21:27   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #15

already
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-29-2016 , 21:30   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #16

Quote:
Originally Posted by Old.School View Post
already
No errors or logs?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 08-29-2016 , 21:43   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #17

there is no errors thnx
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-30-2016 , 05:54   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #18

Quote:
Originally Posted by EFFx View Post
Do what KliPPy said.

PHP Code:
public menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroymenu );
        return 
PLUGIN_HANDLED;
    }
    switch( 
item )
    {
        case 
0:
        {
            
iArrestid );
        }
        case 
1:
        {
            
iUnArrestid );
        }
    }
    return 
PLUGIN_HANDLED;

No, not like that, that will leak memory because you are not destroying the menu every time. Just leave one menu_destroy() call at the end of the function.
klippy is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-30-2016 , 17:03   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #19

Quote:
that will leak memory
Seriously? LOL, i have so many plugins with this format, i'll do that now.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Old.School
Senior Member
Join Date: Sep 2015
Location: France
Old 09-01-2016 , 10:25   Re: [AMXX] Run time error 4: index out of bounds
Reply With Quote #20

Quote:
Originally Posted by EFFx View Post
Seriously? LOL, i have so many plugins with this format, i'll do that now.
how to know which plugin leaking memory...?
__________________
You keep bringing B.R down .. He will rise again and kick Enemies asses !
Old.School 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 09:17.


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