Problem with orientation on iOS8

I am developing portrait app for iOS . In that app, I have mini game that is in landscape mode. The orientation change to landscape in mini game. When I’m in that mini game and go to home screen using home button, when I return to the game, orientation changes to Portrait Upside Down.
(below capture is not my app. but problem is same.)

Before going to home screen

When returning to app:

This problem first appeared when iOS8 came out and I installed xCode 6. The game worked in IOS7. Problem appears only on devices that have iOS8 on them.

Link to fix