Merge "Fix native crash when enabling hardware acceleration."