Disposing intptr after usage