[SOLVED] error in slave when deletenode function run in master


photo

Recommended Posts

I can create a node at runtime, but when I try to delete it, I encounter "Not Responding" in the slaves.

    if(isMaster)
    {
        if(engine.app.clearKeyState('c'))
        {
            objMeshStatic = add_editor(new ObjectMeshStatic("box.mesh"));
            master.createNode(objMeshStatic,1,1);
        }
        if(engine.app.clearKeyState('x'))
        {            
            remove_editor(objMeshStatic);
            master.removeSyncNode(master.getNumSyncNodes() - 1);
            master.deleteNode(objMeshStatic,1);
        }        
    }
 

Link to post

Hi Mahasan,

You need to send "delete" message before destroying the node from the memory:

if(engine.app.clearKeyState('x'))
{
	// send to all slaves
	master.deleteNode(objMeshStatic,1); // removeSyncNode() calls automatically inside this
	
	// free memory
	remove_editor(objMeshStatic);
} 

Best regards,
Alexander

Link to post

not work again

my c++ code

if (syncker_manager->isMasterInitialized())
    {
        if (Unigine::App::get()->clearKeyState('h'))
        {
            ref = NodeReference::create("Cuboid.node");
            Editor::get()->addNode(ref->getNode());
            ref->release();

            syncker_master->createNode(ref->getNode(), 1, 1);
        }
        if (Unigine::App::get()->clearKeyState('c'))
        {
            syncker_master->deleteNode(ref->getNode(),0);
            Editor::get()->removeNode(ref->getNode());
            ref->release();
        }
    }

Link to post

 

never mind ... i've soleved my problem by customizing syncker dll like below

in function (Slave::read_tcp_node_delete) in synckerslave.cpp  class of syncker; i change this line

//remove this

int type = tcp_socket->readInt();

 

//put this one 
int type = (int)tcp_socket->readChar();

Link to post
  • silent changed the title to [SOLVED] error in slave when deletenode function run in master