Fixed init/detach shader order that causes crash on Tegra3.