Tom Stellard <t...@stellard.net> writes:

> From: Tom Stellard <thomas.stell...@amd.com>
>
> After pipe_loader_release() is called, if any of the pipe_* objects
> try to call into the gallium API the application will segfault.
>
> The only time devices are deleted is when the global _clover_platform
> object is deleted by the static destructor.  However,  since application
> objects that are deleted by the static destructor *after*
> _clover_platform might try to make a CL API calls from their destructor,
> it is never safe to call pipe_loader_release().

Please have a look at the clover-internal-ref-counting branch [1] of my
mesa tree, it should fix a number of memory management-related bugs,
possibly the one you've encountered too, without the negative side
effects of dropping the call to pipe_loader_release().

Thanks.

[1] 
http://cgit.freedesktop.org/~currojerez/mesa/log/?h=clover-internal-ref-counting

> ---
>  src/gallium/state_trackers/clover/core/device.cpp | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/device.cpp 
> b/src/gallium/state_trackers/clover/core/device.cpp
> index 76a49d0..2290366 100644
> --- a/src/gallium/state_trackers/clover/core/device.cpp
> +++ b/src/gallium/state_trackers/clover/core/device.cpp
> @@ -48,8 +48,6 @@ device::device(clover::platform &platform, 
> pipe_loader_device *ldev) :
>  device::~device() {
>     if (pipe)
>        pipe->destroy(pipe);
> -   if (ldev)
> -      pipe_loader_release(&ldev, 1);
>  }
>  
>  bool
> -- 
> 1.8.1.4

Attachment: pgpfmKS4qHXMW.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to