Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null-pointer dereference #42

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments
Open

Null-pointer dereference #42

GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

In our multi-threaded application, we have a thread that renders osg, and 
another one that displays a GUI. That GUI changes ocean properties, such as 
refraction.

When enabling/disabling refraction, a null-pointer is dereferenced in 
OceanScene::ViewData::cull()

I do not know the exact sequence that causes this, but I simply added a check 
for null-pointers and the problem went away.

Here's a patch file of my modifications in OceanScene.cpp.

Any idea why this might happen?

Original issue reported on code.google.com by [email protected] on 13 Feb 2012 at 8:51

Attachments:

@GoogleCodeExporter
Copy link
Author

Hi Francis,

Thanks for pointing this out. I'm quite surprised this happens when you 
enable/disable refractions - all those functions do is set a flag for 
OceanScene to apply the setting on the next update traversal. I'll have a look 
at the code and see if anything jumps out at me. Although I have to confess 
I've not tested osgOcean in a multi-threaded application.

In the mean time I've applied your patch.

Cheers,

Kim.

Original comment by [email protected] on 14 Feb 2012 at 2:09

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

I've tried to figure out what was going on, but could not find out the exact 
sequence. The lead I was following before I gave up and wrote this patch is as 
follows:

OceanScene::ViewData::init() will create the "osgOcean_EnableRefractions" 
variable with the current value from the OceanScene. Then it will look again at 
the value from the scene and create cameras. The value might have changed in 
the meanwhile.

Hope this helps.

Thank you very much Kim, for the fast response time. It's really appreciated.

Regards,
Francis

Original comment by [email protected] on 14 Feb 2012 at 3:31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant