Commits

Karl Rupp  committed 824c3e1

Fixed memory leak in VecGetArray()/VecGetArrayRead() for ViennaCL bindings.

This is a follow-up-fix for 4a73821034819dcad1293eaa084b5d44928428de, which only dealt with the CUSP part.

  • Participants
  • Parent commits 4f97bae

Comments (0)

Files changed (1)

File src/vec/vec/interface/rvector.c

     }
 #endif
 #if defined(PETSC_HAVE_VIENNACL)
-    if (x->valid_GPU_array == PETSC_VIENNACL_GPU || !*((PetscScalar**)x->data)) {
+    if (x->valid_GPU_array == PETSC_VIENNACL_GPU) {
       ierr = VecViennaCLCopyFromGPU(x);CHKERRQ(ierr);
     }
 #endif
     }
 #endif
 #if defined(PETSC_HAVE_VIENNACL)
-    if (x->valid_GPU_array == PETSC_VIENNACL_GPU || !*((PetscScalar**)x->data)) {
+    if (x->valid_GPU_array == PETSC_VIENNACL_GPU) {
       ierr = VecViennaCLCopyFromGPU(x);CHKERRQ(ierr);
     }
 #endif