Processes of magnetic-energy conversion and solar flares