aboutsummaryrefslogtreecommitdiff
path: root/src/cuda.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cuda.c')
-rw-r--r--src/cuda.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cuda.c b/src/cuda.c
index 470747b..ea14e8b 100644
--- a/src/cuda.c
+++ b/src/cuda.c
@@ -94,6 +94,11 @@ bool gsr_cuda_load(gsr_cuda *self, Display *display, bool do_overclock) {
}
void gsr_cuda_unload(gsr_cuda *self) {
+ if(self->do_overclock && self->overclock.xnvctrl.library) {
+ gsr_overclock_stop(&self->overclock);
+ gsr_overclock_unload(&self->overclock);
+ }
+
if(self->library) {
if(self->cu_ctx) {
self->cuCtxDestroy_v2(self->cu_ctx);
@@ -102,10 +107,5 @@ void gsr_cuda_unload(gsr_cuda *self) {
dlclose(self->library);
}
- if(self->do_overclock && self->overclock.xnvctrl.library) {
- gsr_overclock_stop(&self->overclock);
- gsr_overclock_unload(&self->overclock);
- }
-
memset(self, 0, sizeof(gsr_cuda));
}