Ok, no it didn't...
But.... I figured out what exactly is causing it.. I just don't know why.
if I do the equivilent of this is C# my program won't exit:
#include <Ewl.h>
int main(int argc, char **argv) {
ewl_init(&argc, argv);
}
which actually translates to:
using System;
public class HelloWorld {
[DllImport("libewl")]
static extern int ewl_init(ref int argc, IntPtr argv);
public static void Main() {
int argc = 0;
IntPtr argv = new IntPtr(0); //got this from gtk-sharp :)
ewl_init(ref argc, argv);
}
}
I run this, and my program just sits there.
The C example just does nothing and exits.
So after commenting out half of ewl_init() in ewl_misc.c I figure out that
the call to ecore_init() is causing the problem.
I uncomment ewl_init and start with ecore_init() and I figure out that the
problem is when _ecore_signal_shutdown() is called from ecore_init() this
line causes the problem:
_ecore_signal_callback_set(SIGPWR, (Signal_Handler) SIG_DFL);
I comment it out and everything works fine.
I'm just like WTF? How weird is that.
Now I'm thinking... Its adding a callback to SIGPWR, could the problem be
I have a laptop, and the battery doesn't work? I don't know... I'm just
confused...
I'm don't know why it would work fine from C and not C#. It could be
Mono... I guess... I'm on the mono-devel list as well... so I'll throw
them a question as well.
Any Ideas on this?
> Hehe, were you able to sort out your issues then?
>
> On Thu, 23 Dec 2004 09:00:54 -0500 (EST), Nigel Benns
> <[EMAIL PROTECTED]> wrote:
>> Apparently I can't spell sourceforge!!!
>>
>> Hi Nathan,
>>
>> Thats the weird thing... I've basically recreated the Helloworld C program
>> in the ewl book, and it doesn't exit for me.
>>
>> I call:
>>
>> ewl_init(argc, argv)
>>
>> create the window, add the delete event and then call
>>
>> ewl_main();
>>
>> the delete event destroys the window, and then calls
>> ewl_main_quit();
>>
>> and then the program just freezes.
>> Kills the window fine, but just sits there.
>> The only way it exits is to hit CTRL-C.
>>
>> It doesn't make any sense.
>> I'm really starting to think it has to be a marshalling problem between C
>> and C#, and I'll throw up something on the mono-list today about it.
>>
>> Everything else works, the events/callbacks, all of the other
functions, I've been looking to gtk-sharp for some resolution to this,
but they're not doing anything I'm not...
>>
>> The weirdest part is, that the program freezes like that if I just call
ewl_init() on its own....
>>
>> and damnit I just think I saw what the problem is... I'll get back to you
>> tommorow whether it works or not.
>>
>> > Most likely, you don't want to be calling ecore_shutdown directly.
>> This
>> should only be called if you called ecore_init at some point. If you
either use ecore_main_loop_quit or ewl_main_quit to shutdown the main
loop, it should exit cleanly. Using Ctrl-C actually goes through the
ecore_main_loop_quit by default, so if it exits correctly using Ctrl-C,
one of the _quit functions should work.
>> >
>> > Good luck!
>> > Nathan
>> >
>> > On Wed, 22 Dec 2004 06:35:47 -0500 (EST), Nigel Benns
>> > <[EMAIL PROTECTED]> wrote:
>> >> I have a question about the main loop in ewl (or ecore really).
>> >>
>> >> I'm trying to create an Ewl-Sharp library and I'm having a problem
>> exitting the main loop function.
>> >>
>> >> In fact once I call ewl_init(argc, argv); I can't exit the program
>> without
>> >> calling ecore_shutdown(); and getting a "Power Failure" message, or
>> hitting Ctrl-C to kill the program. I don't even need to be going into
ewl_main(); for it to do this.
>> >>
>> >> I think something may be going out of scope.
>> >> I know that the ewl_main_quit(); function doesn't kill it right away,
>> but
>> >> says that "Quits the main loop once all the events currently on the
>> queue
>> >> have been processed." but this doesn't seem to be the problem, I can
>> get out of the main loop fine, I've proven this by compiling printf
statements
>> >> into the code for debugging. The program just sits there after the
>> main
>> loop doing nothing, or what I perceive as nothing anyway.
>> >>
>> >> So I guess my question is: Is there anything that ewl_init() or
>> ecore_init() set up that could cause the program to freeze if they went
out of scope, or could a pointer get lost if I'm not preserving
something
>> >> on the managed code side? Everything else is going so smooth as ewl
>> is
>> completely serialized. No C-Glue like the gtk libs need :)
>> >>
>> >> Anyone have an Idea on this... and anyone who wants to help out is
>> welcome
>> >> as well.
>> >
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real
users. Discover which products truly live up to the hype. Start reading
now. http://productguide.itmanagersjournal.com/
>> _______________________________________________
>> enlightenment-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>>
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel