[Mesa-dev] [PATCH] clover: Don't call pipe_loader_release() when deleting a device

Tom Stellard tom at stellard.net
Wed Feb 12 12:39:38 PST 2014


From: Tom Stellard <thomas.stellard at 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().
---
 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



More information about the mesa-dev mailing list