No, it is definitely not the ultimate solution. By renovating leaky roofs and plumbing systems along with sealing off some structural points in the house, you can reduce the levels of moisture inside the house causing mold proliferation. However, opting for such extensive work will need you to dish out a considerable amount of money.
On the other hand, dehumidifiers can give you the same result against mold growth in the fraction of those extensive renovation plans. A dehumidifier is not an ultimate solution against mold. But it is certainly the most cost-effective one.