function registration is very very slow

Started by
28 comments, last by brightening-eyes 10 years, 5 months ago

when i'm trying to compile a script, it crashe's: (i created a save dialog, when i choose save to start compiling, it crashe's my application)

i think the problem is for byetcodes

when you can't see well like me, you can't test your applications and you can't read something

Github

Advertisement
Please show me the script you're trying to compile when it crashes.

I need details in order to investigate the problem.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

this is the script that i'm trying to compile:

void main()
{
agc_lz_compress("C:\a", "C:\a.dat", 1024*1024);
}

i'm working on an Operating System and i don't get errors as much as this engine

when you can't see well like me, you can't test your applications and you can't read something

Github

Thanks for the script. I'll see if I can reproduce the problem.

In the future try to be more specific when reporting errors. Provide as much information as possible and I'll be able to help you faster.

It would really help seeing the callstack when the crash occurs, so I can figure exactly in which part of the code the problem is.

PS. You may also want to take extra care with your writing so as not to offend anyone by mistake.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

The script you're trying to compile should compile just fine, except that it has a couple of warnings:

test (1, 1) : Info : Compiling void main()
test (3, 27) : Warning : Invalid escape sequence
test (3, 19) : Warning : Invalid escape sequence

The warnings are because of the \a in the paths.

I didn't get any crashes, though.

I took a look at your message callback and I believe I found the cause of your crash.

The wxString you're using has no operator += that takes an int. As there is no such operator, nor a constructor that the compiler can use to convert the int to a wxString the C++ compiler is likely converting the int to a pointer. The crash probably happens when wxString tries to copy from this invalid pointer.

void messagecallback(const asSMessageInfo *info, void *param)
{
    wxString type;
    if(info->type==asMSGTYPE_ERROR)
    {
        type="error";
    }
    else if(info->type==asMSGTYPE_WARNING)
    {
        type="worning";
    }
    else if(info->type==asMSGTYPE_INFORMATION)
    {
        type="information";
    }
    else
    {
        type="unknown";
    }
    wxString message="file: ";
    message+=info->section;
    message+="\nline: ";
    message+=info->row;   // <<<--- this is wrong, wxString has no operator+=(int) 
    message+="\nColumn: ";
    message+=info->col;   // <<<--- this is wrong,  wxString has no operator+=(int)
    message+="\n";
    message+=type;
    message+=": ";
    message+=info->message;
    wxMessageBox(message, type, wxOK, NULL, -1, -1);
}

I've never used wxWidgets myself, but from the manual it appears to have the operator<<(int) that does what you intended to do with the +=, i.e formats the integer into a string and appends it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

thanks in advance!

but i don't know why it crashe's

if i knew that, i fix it myself

again thanks

when you can't see well like me, you can't test your applications and you can't read something

Github

First, try to commment out the two lines I indicated as being incorrect in your message callback, and test your application to see if the crash goes away. If the crash goes away you know these are the cause, and you can try to format the line and column into the text in a different way (e.g. using the << operator).

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

i commented the lines that you sed, but it crashed: allegro game creator has stop working

when you can't see well like me, you can't test your applications and you can't read something

Github

I'm sorry to hear that. Unfortunately I have no idea what else may be the cause for the crash.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

ok!

thank's for the information that you've provided!

when you can't see well like me, you can't test your applications and you can't read something

Github

This topic is closed to new replies.

Advertisement