diff options
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/plugin/plugin-nvptx.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 660fc92..fb69402 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-01-24 Tom de Vries <tdevries@suse.de> + + * plugin/plugin-nvptx.c (GOMP_OFFLOAD_fini_device): Free ptx_devices + once instantiated_devices drops to 0. + 2019-01-23 Tom de Vries <tdevries@suse.de> PR target/PR88946 diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index ff90b67..387e7cc 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1936,6 +1936,12 @@ GOMP_OFFLOAD_fini_device (int n) instantiated_devices--; } + if (instantiated_devices == 0) + { + free (ptx_devices); + ptx_devices = NULL; + } + pthread_mutex_unlock (&ptx_dev_lock); return true; } |