Canberk S

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

115 Neutral

About Canberk S

  • Rank
    Newbie
  1. A Question of Array of Handles

    It worked !! Thank you very much   !!!
  2. A Question of Array of Handles

    I've put cout << "CRef::~Cref()" << endl; to the destructor of CRef. But nothing is printed to the stdout. I have started a memory checking program; and I had a lot of memory leaks about CRef.
  3. A Question of Array of Handles

    Let's consider that I have C++ function which is returning an array of handles of an registered reference type (with reference counting). The object type registered in script engine is "ref" and in C++ it's CRef The function is registered as "array<ref@>@ CreateArrayOfHandles" it's looking like this : CScriptArray *CreateArrayOfHandles() { asIScriptContext *ctx = asGetActiveContext(); if( ctx ) { asIScriptEngine* engine = ctx->GetEngine(); asIObjectType* t = engine->GetObjectTypeById(engine->GetTypeIdByDecl("array<ref@>")); CScriptArray* arr = new CScriptArray(3, t); for( unsigned int i = 0; i < arr->GetSize(); i++ ) { CRef *ptr = new CRef; arr->SetValue(i, &ptr); } return arr; } return 0; } First, Is it good ? Second, Will the CRef objects destroyed automatically by script engine ? (CRef is registered as reference type with AddRef and Release functions are registered.)
  4. A Question About Passing Objects To Functions

      I solved it. Just a simple spelling mistake.
  5. Hi ! I have written a simple function in a class like this : class myClass { public: /* other members */ double xyz(unsigned int id, unsigned int valIndex, unsigned int tupleIndex) const { return id * valIndex * tupleIndex; } bool createScriptingEngine { /* must-be-done stuff */ ScriptingEngine->RegisterGlobalFunction( "double xyz(uint, uint, uint)", asMETHOD(myClass, xyz), asCALL_THISCALL_ASGLOBAL, this); /* other stuff */ } /* other members */ }; After I created an instance of myClass and called createScriptingEngine function. Then when i tried to run the following script : class ng { /* other members */ private uint index; private uint ngId; /* id of numgen */ int getIntTupleElement(uint i) { return xyz(ngId, index, i); } /* other members */ } /* other things */ And I got the error : No matching signatures to 'xyz(uint&, uint&, uint)   . So the questions are : Why do I get this error ? AND How can i fix it ???
  6. Using AngelScript in Multithreaded Applications

    Yes, of course. According to the output of debugging, it was an crash caused by X Window System. It seems insane, because as I know, wxThread is based on POSIX Threads. Even I make wxalert(wxString &msg) function an empty function, I get similar errors. The crash usually happens when "m_frm->m_scriptcontext->Execute();" is executed. Then I thought that the crash is caused by wxWidgets logging system. Then I commented "wxLog..." lines. But it didn't work. Perhaps the problem is because of my wrong multithreading usage. Could you provide me an application using AngelScript with pthreads ? If it works on my computer, it will show that the problem is caused by wxWidgets. By the way, I modified and used scriptstdstring to work with wxString. Maybe the problem is caused by it. I attach it.
  7. Hi guys! I'm trying to write a simple GUI-based interpreter for AngelScript to be used in my future projects. It uses multithreading. The multithreading support is provided by wxWidgets. Problem is that even I try to execute just a little piece of code (script), it crashes. My application is programmed to run just one script at once. It's using asIScriptEngine in MyFrame class, so it's not created every script execution session. In each script execution thread, asIScriptContext is created, so the same context is not used for every script execution session. But it's not running . Help me plz. My system configuration : I'm working under x64 Linux environment, my distro is Ubuntu 12.04. I'm using g++ 4.6.3. My GUI toolkit is wxWidgets 2.9.5 . I compiled it my own. My AngelScript version is 2.28.0 . I'm using CodeBlocks IDE. I have rewritten scriptstdstring add-on to work with wxString. The source code of the application is attached.