Proper way to deal with transient resources?