Load & Unload

All other Source.Python topics and issues.
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Load & Unload

Postby Omega_K2 » Wed Jul 18, 2012 3:47 pm

When writing the logging stuff I noticed something:


When loading an addon, the loading will succeed even if the load() function fails to execute.
When unloading an addon, the unload will fail if the unload() function raises an exception.


Shouldn't that be the other way around? Loading should not succeed if the load function contains errors.
This would cause the addon to fail loading, while load would not:

Syntax: Select all

def MyLoad():
do_something_causing_exceptions()

MyLoad()


Similarily, if the unloading fails, the addon should be removed still (so at the very least that you can load it again - right now you need to restart the server or remove it manually to get it working again)
User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Jul 19, 2012 12:06 am

I'll look into that. Thanks.

Satoon
User avatar
satoon101
Project Leader
Posts: 2698
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Jul 19, 2012 1:09 am

This "should" be fixed in the newest build. Let me know if you find otherwise.

Thanks again for reporting this bug.

Satoon

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests