Will a paper be retracted if a flaw in released software code invalidates its central idea?
If the main idea in the paper has been invalidated by the correction in the code, you would do well to try to retract the paper yourself. This is just a point of professional ethics. It also protects you in a way from future claims if people don't examine everything thoroughly. 

The journal may not be able to actually retract the paper, but might be able to post a note (printed or online) that the paper has a flaw (noted by the author, hopefully). 

But others, relying on the original thesis of the paper might be misled in their own work. You really don't want that to happen. 

Honesty in science is assumed. Make it so. 

You might also be able to publish a better paper, based on the corrected code. Work toward that end.