FIX memory leak because dettached element on inline function

Please don't make unrelated indentation changes like this.