This happens when you have nothing to do besides playing poker... You should do more things in your life and take poker just as a free time activity, play for certain amount of time no matter how is your game going today (may quit faster if its really bad).
How no to lose all your money? Simply dont do it.
There is no other way, just control yourself, is it that hard?
If its hard for you to control yourself, start doing combat sports where you can express your negative feelings and trust me after some time spent doing martial arts or combat sports, your self control will be much much better