Menu

#72 MPV - switching to a broken database doesn't fail

open
MPV (26)
5
2009-01-07
2009-01-07
No

If the MPV is set up with two terrain databases, one which works (say, "/opt/data/terrain/STL/archive.txp") and another which does not exist but has the same basename (say, "/foo/bar/archive.txp") then the following sequence will not produce the expected results:

- switch to the working database, and allow it to load
- switch to the non-existent database

The observed results are that the MPV will report success, and will display the old, working database (.../STL/archive.txp).

The expected results are that the MPV will fail to load the non-existent database, and will report the error.

The suspected cause of this error is that OSG's terrapage loader will implicitly add the directory of a requested terrain to the OSG content search path. This in itself is not a problem (it is quite useful). The problem is that the directory is not removed from the search path after we are no longer interested in that database. Subsequent requests for "archive.txp" will return the old database.

See OSG's TXPArchive.cpp, TXPArchive::openFile() for the code which adds the database path to the content search path.

Discussion