Changeset 256

Show
Ignore:
Timestamp:
04/24/07 13:15:01 (1 year ago)
Author:
aldacron
Message:

[DerelictUtil?]
* the loader will now throw an exception when it detects that a package's internal load function has not been set. This can happen when calling Derelict*.load methods from a static module or class constructor. Before, there was no check for this case and the call would cause an Access Violation due to a null function pointer. Now, this is tested for and the exception message will give a better idea what is going on when this happens.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/DerelictUtil/derelict/util/loader.d

    r250 r256  
    382382 
    383383        myLib = Derelict_LoadSharedLib(libNames); 
     384         
     385        if(userLoad is null) 
     386        { 
     387            throw new DerelictException("The internal load function has not been configured. You are most likely calling a Derelict load method from a module constructor, or a static class constructor. Don't."); 
     388        } 
    384389        userLoad(myLib); 
    385390    }