Should probably call ``VarRefDestroy(ref);`` here to not leak memory.