Fix the warnings of setParent in different thread