OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

node->removeUpdateCallback


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
Cedric Pinson
Guest





PostPosted: Sun Feb 01, 2009 9:32 pm    Post subject:
node->removeUpdateCallback
Reply with quote

Hi Robert,

I just get a crash with the trunk with the following code:

node->removeUpdateCallback(MyNodeCallback)

if there is no NodeCallback already set it crashes, if the
MyNodeCallback is 0 it crashes too.
So i suggest to add this code:

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback.valid() && nc != 0)
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}

instead of

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}


Does it make sense for you ?

Cheers,
Cedric

--
+33 (0) 6 63 20 03 56 Cedric Pinson mailto:mornifle@plopbyte.net http://www.plopbyte.net




------------------
Post generated by Mail2Forum
Back to top
Sukender
Appreciator


Joined: 29 Jan 2009
Posts: 680

PostPosted: Mon Feb 02, 2009 6:29 am    Post subject:
node->removeUpdateCallback
Reply with quote

Yes, Cédric, that sounds logical to me (This was a tiny submission of mine). However, I'd add some braces for the "if" statement ;)

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Sun, 01 Feb 2009 22:32:29 +0100, Cedric Pinson <> a écrit:

Quote:
Hi Robert,

I just get a crash with the trunk with the following code:

node->removeUpdateCallback(MyNodeCallback)

if there is no NodeCallback already set it crashes, if the
MyNodeCallback is 0 it crashes too.
So i suggest to add this code:

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback.valid() && nc != 0)
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}

instead of

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}


Does it make sense for you ?

Cheers,
Cedric



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Sukender
Appreciator


Joined: 29 Jan 2009
Posts: 680

PostPosted: Mon Feb 02, 2009 8:36 am    Post subject:
node->removeUpdateCallback
Reply with quote

Hi Cédric, hi Robert,

Forgot to mention that's the same for removeEventCallback() and removeCullCallback().
BTW, add*Callback() may also need to check if the 'nc' is not NULL (since we don't expect "add" to add a NULL callback anywhere).
So, attached is the modified file, against rev. 9615 of the trunk, with both "add" and "remove" modified.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Mon, 02 Feb 2009 07:29:34 +0100, Sukender <> a écrit:

Quote:
Yes, Cédric, that sounds logical to me (This was a tiny submission of mine). However, I'd add some braces for the "if" statement ;)

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Sun, 01 Feb 2009 22:32:29 +0100, Cedric Pinson <> a écrit:

Quote:
Hi Robert,

I just get a crash with the trunk with the following code:

node->removeUpdateCallback(MyNodeCallback)

if there is no NodeCallback already set it crashes, if the
MyNodeCallback is 0 it crashes too.
So i suggest to add this code:

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback.valid() && nc != 0)
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}

instead of

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}


Does it make sense for you ?

Cheers,
Cedric





------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Cedric Pinson
Guest





PostPosted: Mon Feb 02, 2009 8:44 am    Post subject:
node->removeUpdateCallback
Reply with quote

Hi,
Yes i just sow after that it's the same thing for event and cull

Cheers,
Cedric

Sukender wrote:
Quote:
Hi Cédric, hi Robert,

Forgot to mention that's the same for removeEventCallback() and removeCullCallback().
BTW, add*Callback() may also need to check if the 'nc' is not NULL (since we don't expect "add" to add a NULL callback anywhere).
So, attached is the modified file, against rev. 9615 of the trunk, with both "add" and "remove" modified.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Mon, 02 Feb 2009 07:29:34 +0100, Sukender <> a écrit:


Quote:
Yes, Cédric, that sounds logical to me (This was a tiny submission of mine). However, I'd add some braces for the "if" statement ;)

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Sun, 01 Feb 2009 22:32:29 +0100, Cedric Pinson <> a écrit:


Quote:
Hi Robert,

I just get a crash with the trunk with the following code:

node->removeUpdateCallback(MyNodeCallback)

if there is no NodeCallback already set it crashes, if the
MyNodeCallback is 0 it crashes too.
So i suggest to add this code:

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback.valid() && nc != 0)
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}

instead of

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}


Does it make sense for you ?

Cheers,
Cedric



------------------------------------------------------------------------




--
+33 (0) 6 63 20 03 56 Cedric Pinson mailto: http://www.plopbyte.net




------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Mon Feb 02, 2009 10:00 am    Post subject:
node->removeUpdateCallback
Reply with quote

Thanks Sukender, fix merged and submitted to SVN.

On Mon, Feb 2, 2009 at 8:36 AM, Sukender <> wrote:
Quote:
Hi Cédric, hi Robert,

Forgot to mention that's the same for removeEventCallback() and removeCullCallback().
BTW, add*Callback() may also need to check if the 'nc' is not NULL (since we don't expect "add" to add a NULL callback anywhere).
So, attached is the modified file, against rev. 9615 of the trunk, with both "add" and "remove" modified.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Mon, 02 Feb 2009 07:29:34 +0100, Sukender <> a écrit:

Quote:
Yes, Cédric, that sounds logical to me (This was a tiny submission of mine). However, I'd add some braces for the "if" statement ;)

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/


Le Sun, 01 Feb 2009 22:32:29 +0100, Cedric Pinson <> a écrit:

Quote:
Hi Robert,

I just get a crash with the trunk with the following code:

node->removeUpdateCallback(MyNodeCallback)

if there is no NodeCallback already set it crashes, if the
MyNodeCallback is 0 it crashes too.
So i suggest to add this code:

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback.valid() && nc != 0)
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}

instead of

inline void removeUpdateCallback(NodeCallback* nc) {
if (_updateCallback == nc)
setUpdateCallback(nc->getNestedCallback()); // replace the
callback by the nested one
else _updateCallback->removeNestedCallback(nc);
}


Does it make sense for you ?

Cheers,
Cedric








------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Deep cloning an active root scene node Robert Lockyer General 7 Thu Feb 28, 2019 5:52 pm View latest post
No new posts osg::LOD node not being considered in... Josiah425 General 1 Tue Feb 19, 2019 6:52 pm View latest post
No new posts Can i use MatrixTransform to transfo... PeterGao General 8 Fri Jan 04, 2019 1:46 pm View latest post
No new posts Update node color on demand dhhabyc General 12 Sat Nov 24, 2018 3:05 pm View latest post
No new posts Detected intersector node smax23 General 0 Fri Nov 23, 2018 1:29 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP