Fixing memory leak in Provider DataRef