In the main function: allocating de ComboBoxDelegate on the heap rather than the stack. Second method didn't worked for me.