In most of the cases a losing position is automatically closed by the brokers system when such situation arises. But, the FX market is quite volatile, if margin level is low over economic news releases or under other abnormal conditions the market can rapidly move against you and the system will close open positions at the next best available price which could in losing the whole deposit or even more than that.