Hostess Brands Inc. is closing after a recent standoff with its striking bakers union. But relations between the Twinkie maker and workers were poisoned months ago amid disclosures that Hostess executives received pay raises not long before seeking bankruptcy protection.

Hostess's bankruptcy judge said during a hearing Thursday that the payments "will definitely be looked at" as he approved the company's request to start liquidating and lay off more than 18,000 employees.

Hostess was exploring a potential bankruptcy filing in July 2011 when its board voted to boost the salary of its chief executive and others, according to creditors. Five months later, it filed for Chapter 11, its second bankruptcy filing in a decade.

In April, creditors, including union representatives, cried foul: They alleged that Hostess made an end run around a federal law that restricts paying bonuses in bankruptcy cases before a judge could scrutinize them. Hostess later rolled back the salaries amid employee protests. Hostess's board approved the raises "long before" deciding on bankruptcy, rewarding executives for extra work, the company said.

Financially ailing companies often pay bonuses and other compensation to executives, directors and private-equity owners in the months before filing for bankruptcy protection. Federal law restricts "retention" bonuses paid to such "insiders" after a bankruptcy case is filed but not before.