Do you mean what's wrong with that code besides the fact that you sent code to
the users mailing list instead of the devel list? :-)
There's nothing wrong with that code.
After several hours debugging, poking, prodding, and testing, it turns out that
you uncovered a bug that was about 8 years old. Even though db_dump() was
written and documented specifically for the way you were trying to use it,
(apparently) it hadn't been tested with in-memory database dumps. The 'dump'
command in mged is the only place it's used, which doesn't write out an
in-memory.
I applied the fix needed along with a couple related cleanups to the trunk
sources. It should work now.
Cheers!
Sean
On Wednesday, September 24, 2008, at 10:58AM, "Daniel Roßberg" <[EMAIL
PROTECTED]> wrote:
>Hello,
>
>What's wrong with this code?
>
>int main
>(
> int argc,
> char* argv[]
>) {
> if (rt_uniresource.re_magic != RESOURCE_MAGIC)
> rt_init_resource(&rt_uniresource, 0, NULL);
>
> db_i* inmemDb = db_create_inmem();
> rt_wdb* targetWdb = wdb_fopen("new.g");
>
> db_dump(targetWdb, inmemDb);
>
> wdb_close(targetWdb);
> db_close(inmemDb);
>
> return 0;
>}
>
>It crashes on Windows inside db_dump.
>
>
>Daniel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel