Reputation: 1425
I want to recycle my image , but since another thread is rendering them, I need to be sure that the rendering has stopped:
private void unload() {
System.out.println("Unloading menu...");
loaded = false;
while(rendering) {
//wait
}
background.recycle();
button.recycle();
button_pushed.recycle();
}
But I dont think this is the best way , are their other ways to do this?
Upvotes: 0
Views: 95
Reputation: 14038
Use thread wait()/notify() mechanism. you will find lots of nice tuts on the web
Upvotes: 1