Code: Select all
class A
{
ISceneNode* node;
};
Code: Select all
A::A(const A& a)
{
//copy code
if(node) node->grab();
}
A::~A()
{
if(node) node->drop();
}
Code: Select all
class A
{
ISceneNode* node;
};
Code: Select all
A::A(const A& a)
{
//copy code
if(node) node->grab();
}
A::~A()
{
if(node) node->drop();
}
Code: Select all
class A
{
ISceneNode * MyNode;
public:
void setNode(ISceneNode* node)
{
node->grab();
MyNode->drop();
MyNode = node;
}
A(ISceneNode *node)
{
(MyNode=node)->grab();
}
~A() //destructor
{
MyNode->drop();
}
}