Forum > Audio and Video

problem for exiting from an app that use UOS


Hello Fred,
Thanks you for sharing your UOS project !
I played a little with the example 'simpleplayer_noflat' and when I exit the application sometime it appear an SIGSEGV exception. I see in your code that you use Sleep before freeing the player:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.FormDestroy(Sender: TObject);begin  if (button3.Enabled = False) then  begin    button6.Click;    sleep(500);          // <<<<<  end;  if button1.Enabled = False then  begin    PlayerIndex1.Free;    uos_free;  end;end; Is Sleep here to wait for the termination of the thread used by Tuos_Player ?
If yes, could you implement please, a proper way to quit the application without this problem ?
Searching in this forum I found this link, may be it can help.,39761.msg273898.html

EDIT:  I've changed sleep(500) to sleep(1000) and the exception doesn't raise any more

Fred vS:
Hello Lulu.

I strongly recommend to use uso_flat.pas for your applications.
All the demos in /uos/examples/ use uos_flat.pas (apart the one you tried and you did see the possible problems).

uos_flat.pas does care of creation and destroy of players and many other things.

Is there a reason why you prefer to not use uos_flat.pas ?

There is a uos forum who centralizes all the questions, you are welcome there.



Thanks you Fred for your answer.
There is no reason to use uos instead of uos_flat. Ok, I continue my uos journey on another example !
The forum is interesting, thanks !


[0] Message Index

Go to full version