Re: [AD] aRts "pure virtual function call"

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Did some test with and without my patch and an explicit allegro_exit. I
> managed to confuse myself:
>
> no patch, no allegro_exit: "pure virtual function call"
> no patch, allegro_exit:    sometimes ok, sometimes "pure virtual..."
> patch,    no allegro_exit: ok
> patch,    allegro_exit:    ok
>
> Adding "int _module_dont_unload_me_dirty_hack = 0;" to arts.c did not seem
> to change anything... BTW, which module are we talking about, allegro arts
> driver as a module, or arts itself ? Which would be not-unloaded by the
> svgalib hack ?

Allegro aRts driver as a module.  For the SVGAlib module, this was sufficient 
to guarantee that the atexit-registered routine was still reachable.

Note that

int _module_dont_unload_me_dirty_hack = 0

is not enough to not unload the driver.  You must set it to '1' somewhere.

> Anyway calling arts_free() more than necessary doesn't seem to hurt. The
> problem is with releasing allegro's arts stream. If we want to do it, it
> must be done before arts has been freed. If arts is freed before all arts
> streams have been released, it issues a warning on the command line.

OK.

> Though in allegro, the warning doesn't seem to reach the console. And it
> doesn't seem to crash anything, either. Humm, then another solution is to
> not free allegro's arts stream. This seems to work, and is *much* simpler:
>
> --- src/unix/arts.c.old 2004-01-29 18:39:32.945607832 +0100
> +++ src/unix/arts.c     2004-01-29 18:39:49.064157440 +0100
> @@ -277,7 +277,7 @@
>     free(_al_arts_bufdata);
>     _al_arts_bufdata = NULL;
>
> -   arts_close_stream(_al_arts_stream);
>     _al_arts_stream = NULL;
>
>     arts_free();
>

No way to detect whether _al_arts_stream is still "valid" before calling 
arts_close_stream on it?

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/