So right now I'm not sure what the problem is.
well. me too :-)
I have no clue what that message means or where it comes from, but it's
not in the OpenSG source tree, so I'm pretty sure it's not from us.
Can you send us a test program that demonstrates the problem?
Ok, I'll try to explain:
My Application crashes with the message:
Unbehandelte Ausnahme bei 0x690d5544 in terrainEditor.exe: 0xC0000005:
Zugriffsverletzung-Leseposition 0x0000386c.
This happens somewhere after I changed the content of that GeoPositions.
While trying to track down the origin of the error I commented out
everything in my leveling routine, but the following::
void OpenSGTerrainView::levelTool( Mask* mask, wxPoint position, float
multiplicator)
{
beginEditCP(_points);
// all commented out
endEditCP(_points);
}
This is getting called when the user clicks with the mouse. I use the
wxWidgets library for my GUI, so this is the callback function:
void TerrainController::OnMouseDown(wxMouseEvent& event)
{
wxPoint position = _terrainView->getPositionOnTerrain(event); //
uses IntersectAction to find out click point in terrain's x/y coordinates
if (position!=wxPoint(-1,-1))
{
// SNIPPED : Get the parameters from GUI
// keep track of operations on the terrain, to enable undoing.
LevelAction* levelAction = new LevelAction(_levelMask,
position, multiplicator, minimum, maximum);
_terrainActionQueue.postAction(levelAction);
levelAction->execute (); // calls the error-causing
OpenSGTerrainView::levelTool function above.
}
// the event proccessing as usual under wxWidgets.
event.Skip();
}
Without the begin/endEditCP's I can run this until I'm bored, but with
it, many clicks - a short pause - and then clicking again crashes the
application almost everytime.
So my interpretation:
I think this has *something* to do with incompatible osg::thread vs.
wxThread. Honestly I know neither of these libraries very good ( a few
months now), and above that I don't have a decent understanding how
threads can be used safe ;-)
The Terrain Generation is started from a wxWizard in a different
(wx)thread, so I *think* I am creating the terrain in a different thread
than I manipulate it. But first i thought this is covered by these
begin/endEditCPs and secondly, I already tried what was proposed in a
recent post from Gerrit to this list:
<snip>
sorry this is not well documented but you must call the following
in each non OSG thread before you can access any OSG fieldcontainer.
_pLocalThread = OSG::ExternalThread::get(NULL);
_pLocalThread->initialize(0); // 0 == OSG Aspect you want to use
after that the respective aspect should be available.
</snip>
Is just pasted this in my code and defined
ExternalThread* _pLocalThread;
before. I wonder what the parameter aspect means (i kept it zero).
I hoped this would also kill my problems (like it did in this case), but the
crash occurs also.
I would really like to send you a short program to show these problems, but I
don't think I could reduce the problem in the short time I have left to finish
the whole application :-( But until I get an answer to these questions I'll try.
Is there a way to find out, which thread is currently running? Get a
system-wide Id or something, to find out who is doing what in this case ?
I know I should know that better, but you know the saying:
"If debugging is the process of removing bugs, than programming must be the process
of putting them in!" :-) I'm afraid there was too much hacking involved in this :-(
Thanks,
Tobi
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users