I'm usually a reader in this sub, but I was just reading Postwar by Tony Judt tonight, and I can kind of answer this question. The short answer is pretty much no in most cases, because it's hard to benefit from running a country if they are actively trying to become an independent state out from under you. In the case of the Netherlands, Indonesia started declaring it's own independence in November 1945, pretty much as soon as WWII had ended. Four years later Indonesian nationalist leaders were in The Hague finalizing their independence.
Britain lost India in 1947 and Israel a year later, but I think they still had a large interest in trading with their former colonies for quite a while after they became independent. A huge part of Britain's motivation in instigating(or escalating?) the Suez Canal crisis was that it was still an important shipping lane to get to Asia, India in particular.
France's colonial situation was pretty much a trainwreck, first with violent conflicts in Vietnam and then Algeria. Charles DeGaulle pretty much said outright that he was ready to start the process of de-colonization: "In French Africa, as in every land where men live under our flag, there can be no true progress...unless they can raise themselves little by little to a level where they can partake in the management of their own affairs. It is the duty of France to bring this about". Most of West Africa went relatively peacefully, and Algeria was messy most because so many Europeans were living there and it was so close in proximity to France itself.
The way Judt sees it, the real issue in the European colonial powers after WWII wasn't so much the money to be made(obviously important), but retaining some sense of national pride after a long and embarrassing war. To quote from Postwar: "At the close of the Second World War, the peoples of Western Europe-- who were hard put to govern or even feed themselves-- continued to rule much of the non-European world. This unseemly paradox, whose implications were not lost on indigenous elites in the European colonies, had perverse consequences. To many in Britain, France or the Netherlands, their countries' colonies and imperial holdings in Africa, Asia, the Middle East and the Americas were balm for the suffering and humiliations of the war in Europe; they had demonstrated their material value in that was as national vital resources."
So that's far from a complete view of the situation, but I guess there's the beginning of a possible answer.
I disagree with discipletr slightly.
I'd say after WW2 the importance of the European empires actually increased. With internal European trade basically destroyed, their own economies exhausted and heavily indebt to the Americans, the empires provided a steady supply of raw materials (and labour force) an a market for goods. Such a system would allow the European nations to prime the pump of their economies. The colonies who have been unable to import during the war going on a spending spree buying goods from home, this provides work for domestic workers who buy goods at home.
But as discipletr at this specific point the anti-colonial movement boils over and really starts making gains, though it takes Africa until the 1960s mainly for independence to actually happen.
I feel it is worth noting that not all colonies were profitable to begin with. Profit was not the only reason for colonisation, factors like prestige and strategic benefits contributed to reasons for colonisation. The French west African colonies were often not very profitable, just like German Namibia. So although losing these colonies was a defeat in prestige it could actually also be a boost to the national economy when the state no longer had to pay for the administration, security and investments in the colony.