Changeset 591

Show
Ignore:
Timestamp:
11/06/11 03:36:56 (7 months ago)
Author:
aldacron
Message:

It is now possible to disable automatic unloading of shared libraries.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Derelict2/DerelictAL/derelict/openal/al.d

    r479 r591  
    166166static this() 
    167167{ 
    168     DerelictAL = new DerelictALLoader(); 
     168   DerelictAL = new DerelictALLoader(); 
    169169} 
    170170 
    171171static ~this() 
    172172{ 
    173     DerelictAL.unload(); 
     173    if(SharedLibLoader.isAutoUnloadEnabled()) 
     174        DerelictAL.unload(); 
    174175} 
  • branches/Derelict2/DerelictAllegro/derelict/allegro/acodec.d

    r574 r591  
    7676static ~this() 
    7777{ 
    78     DerelictAllegroACodec.unload(); 
     78    if(SharedLibLoader.isAutoUnloadEnabled()) 
     79        DerelictAllegroACodec.unload(); 
    7980} 
  • branches/Derelict2/DerelictAllegro/derelict/allegro/allegro.d

    r551 r591  
    376376        bindFunc(cast(void**)&al_invert_transform, "al_invert_transform"); 
    377377        bindFunc(cast(void**)&al_check_inverse, "al_check_inverse"); 
    378          
     378 
    379379        bindFunc(cast(void**)&al_ustr_new, "al_ustr_new"); 
    380380        bindFunc(cast(void**)&al_ustr_new_from_buffer, "al_ustr_new_from_buffer"); 
     
    457457static ~this() 
    458458{ 
    459     DerelictAllegro.unload(); 
     459    if(SharedLibLoader.isAutoUnloadEnabled()) 
     460        DerelictAllegro.unload(); 
    460461} 
  • branches/Derelict2/DerelictAllegro/derelict/allegro/audio.d

    r574 r591  
    492492static ~this() 
    493493{ 
    494     DerelictAllegroAudio.unload(); 
    495 
     494    if(SharedLibLoader.isAutoUnloadEnabled()) 
     495        DerelictAllegroAudio.unload(); 
     496
  • branches/Derelict2/DerelictAllegro/derelict/allegro/font.d

    r574 r591  
    164164static ~this() 
    165165{ 
    166     DerelictAllegroFont.unload(); 
     166    if(SharedLibLoader.isAutoUnloadEnabled()) 
     167        DerelictAllegroFont.unload(); 
    167168} 
  • branches/Derelict2/DerelictAllegro/derelict/allegro/image.d

    r574 r591  
    7979static ~this() 
    8080{ 
    81     DerelictAllegroImage.unload(); 
     81    if(SharedLibLoader.isAutoUnloadEnabled()) 
     82        DerelictAllegroImage.unload(); 
    8283} 
  • branches/Derelict2/DerelictFMOD/derelict/fmod/fmodex.d

    r478 r591  
    457457static ~this() 
    458458{ 
    459     DerelictFMODEX.unload(); 
     459    if(SharedLibLoader.isAutoUnloadEnabled()) 
     460        DerelictFMODEX.unload(); 
    460461} 
  • branches/Derelict2/DerelictFT/derelict/freetype/ft.d

    r560 r591  
    358358static ~this() 
    359359{ 
    360     DerelictFT.unload(); 
    361 
     360    if(SharedLibLoader.isAutoUnloadEnabled()) 
     361        DerelictFT.unload(); 
     362
  • branches/Derelict2/DerelictGL/derelict/opengl/gl.d

    r589 r591  
    10381038static ~this() 
    10391039{ 
    1040     DerelictGL.unload(); 
     1040    if(SharedLibLoader.isAutoUnloadEnabled()) 
     1041        DerelictGL.unload(); 
    10411042} 
  • branches/Derelict2/DerelictGL/derelict/opengl/glu.d

    r470 r591  
    119119static ~this() 
    120120{ 
    121     DerelictGLU.unload(); 
     121    if(SharedLibLoader.isAutoUnloadEnabled()) 
     122        DerelictGLU.unload(); 
    122123} 
  • branches/Derelict2/DerelictIL/derelict/devil/il.d

    r409 r591  
    156156static ~this() 
    157157{ 
    158     DerelictIL.unload(); 
     158    if(SharedLibLoader.isAutoUnloadEnabled()) 
     159        DerelictIL.unload(); 
    159160} 
  • branches/Derelict2/DerelictIL/derelict/devil/ilu.d

    r409 r591  
    113113static ~this() 
    114114{ 
    115     DerelictILU.unload(); 
     115    if(SharedLibLoader.isAutoUnloadEnabled()) 
     116        DerelictILU.unload(); 
    116117} 
  • branches/Derelict2/DerelictIL/derelict/devil/ilut.d

    r411 r591  
    114114static ~this() 
    115115{ 
    116     DerelictILUT.unload(); 
     116    if(SharedLibLoader.isAutoUnloadEnabled()) 
     117        DerelictILUT.unload(); 
    117118} 
  • branches/Derelict2/DerelictODE/derelict/ode/ode.d

    r486 r591  
    632632static ~this() 
    633633{ 
    634     DerelictODE.unload(); 
     634    if(SharedLibLoader.isAutoUnloadEnabled()) 
     635        DerelictODE.unload(); 
    635636} 
  • branches/Derelict2/DerelictOgg/derelict/ogg/ogg.d

    r561 r591  
    142142static ~this() 
    143143{ 
    144     DerelictOgg.unload(); 
     144    if(SharedLibLoader.isAutoUnloadEnabled()) 
     145        DerelictOgg.unload(); 
    145146} 
  • branches/Derelict2/DerelictOgg/derelict/ogg/vorbis.d

    r561 r591  
    106106static ~this() 
    107107{ 
    108     DerelictVorbis.unload(); 
     108    if(SharedLibLoader.isAutoUnloadEnabled()) 
     109        DerelictVorbis.unload(); 
    109110} 
  • branches/Derelict2/DerelictOgg/derelict/ogg/vorbisenc.d

    r561 r591  
    7373static ~this() 
    7474{ 
    75     DerelictVorbisEnc.unload(); 
     75    if(SharedLibLoader.isAutoUnloadEnabled()) 
     76        DerelictVorbisEnc.unload(); 
    7677} 
  • branches/Derelict2/DerelictOgg/derelict/ogg/vorbisfile.d

    r561 r591  
    110110static ~this() 
    111111{ 
    112     DerelictVorbisFile.unload(); 
     112    if(SharedLibLoader.isAutoUnloadEnabled()) 
     113        DerelictVorbisFile.unload(); 
    113114} 
  • branches/Derelict2/DerelictPA/derelict/portaudio/pa.d

    r484 r591  
    3030public 
    3131{ 
    32    import derelict.portaudio.patypes; 
    33    import derelict.portaudio.pafuncs; 
     32    import derelict.portaudio.patypes; 
     33    import derelict.portaudio.pafuncs; 
    3434} 
    3535 
    3636private 
    3737{ 
    38    import derelict.util.loader; 
     38    import derelict.util.loader; 
    3939} 
    4040 
     
    4242{ 
    4343public: 
    44    this() 
    45    
    46        super( 
    47            "PortAudio.dll", 
    48            "portaudio.so,libportaudio.so", 
    49            "" 
    50        ); 
    51    
    52      
     44    this() 
     45   
     46        super( 
     47            "PortAudio.dll", 
     48            "portaudio.so,libportaudio.so", 
     49            "" 
     50        ); 
     51   
     52 
    5353protected: 
    54    override void loadSymbols() 
    55    
    56        bindFunc(cast(void**)&Pa_GetVersion, "Pa_GetVersion"); 
    57        bindFunc(cast(void**)&Pa_GetVersionText, "Pa_GetVersionText"); 
    58        bindFunc(cast(void**)&Pa_GetErrorText, "Pa_GetErrorText"); 
    59        bindFunc(cast(void**)&Pa_Initialize, "Pa_Initialize"); 
    60        bindFunc(cast(void**)&Pa_Terminate, "Pa_Terminate"); 
    61        bindFunc(cast(void**)&Pa_GetDefaultHostApi, "Pa_GetDefaultHostApi"); 
    62        bindFunc(cast(void**)&Pa_GetHostApiInfo, "Pa_GetHostApiInfo"); 
    63        bindFunc(cast(void**)&Pa_HostApiTypeIdToHostApiIndex, "Pa_HostApiTypeIdToHostApiIndex"); 
    64        bindFunc(cast(void**)&Pa_HostApiDeviceIndexToDeviceIndex, "Pa_HostApiDeviceIndexToDeviceIndex"); 
    65        bindFunc(cast(void**)&Pa_GetLastHostErrorInfo, "Pa_GetLastHostErrorInfo"); 
    66        bindFunc(cast(void**)&Pa_GetDeviceCount, "Pa_GetDeviceCount"); 
    67      
    68        bindFunc(cast(void**)&Pa_GetDefaultInputDevice, "Pa_GetDefaultInputDevice"); 
    69        bindFunc(cast(void**)&Pa_GetDefaultOutputDevice, "Pa_GetDefaultOutputDevice"); 
    70        bindFunc(cast(void**)&Pa_GetDeviceInfo, "Pa_GetDeviceInfo"); 
    71        bindFunc(cast(void**)&Pa_IsFormatSupported, "Pa_IsFormatSupported"); 
    72        bindFunc(cast(void**)&Pa_OpenStream, "Pa_OpenStream"); 
    73        bindFunc(cast(void**)&Pa_OpenDefaultStream, "Pa_OpenDefaultStream"); 
    74        bindFunc(cast(void**)&Pa_CloseStream, "Pa_CloseStream"); 
    75        bindFunc(cast(void**)&Pa_SetStreamFinishedCallback, "Pa_SetStreamFinishedCallback"); 
    76        bindFunc(cast(void**)&Pa_StartStream, "Pa_StartStream"); 
    77        bindFunc(cast(void**)&Pa_StopStream, "Pa_StopStream"); 
    78        bindFunc(cast(void**)&Pa_AbortStream, "Pa_AbortStream"); 
    79        bindFunc(cast(void**)&Pa_IsStreamStopped, "Pa_IsStreamStopped"); 
    80        bindFunc(cast(void**)&Pa_IsStreamActive, "Pa_IsStreamActive"); 
    81        bindFunc(cast(void**)&Pa_GetStreamInfo, "Pa_GetStreamInfo"); 
    82        bindFunc(cast(void**)&Pa_GetStreamTime, "Pa_GetStreamTime"); 
    83        bindFunc(cast(void**)&Pa_GetStreamCpuLoad, "Pa_GetStreamCpuLoad"); 
    84        bindFunc(cast(void**)&Pa_ReadStream, "Pa_ReadStream"); 
    85        bindFunc(cast(void**)&Pa_WriteStream, "Pa_WriteStream"); 
    86        bindFunc(cast(void**)&Pa_GetStreamReadAvailable, "Pa_GetStreamReadAvailable"); 
    87        bindFunc(cast(void**)&Pa_GetStreamWriteAvailable, "Pa_GetStreamWriteAvailable"); 
    88        bindFunc(cast(void**)&Pa_GetSampleSize, "Pa_GetSampleSize"); 
    89        bindFunc(cast(void**)&Pa_Sleep, "Pa_Sleep"); 
    90    
     54    override void loadSymbols() 
     55   
     56        bindFunc(cast(void**)&Pa_GetVersion, "Pa_GetVersion"); 
     57        bindFunc(cast(void**)&Pa_GetVersionText, "Pa_GetVersionText"); 
     58        bindFunc(cast(void**)&Pa_GetErrorText, "Pa_GetErrorText"); 
     59        bindFunc(cast(void**)&Pa_Initialize, "Pa_Initialize"); 
     60        bindFunc(cast(void**)&Pa_Terminate, "Pa_Terminate"); 
     61        bindFunc(cast(void**)&Pa_GetDefaultHostApi, "Pa_GetDefaultHostApi"); 
     62        bindFunc(cast(void**)&Pa_GetHostApiInfo, "Pa_GetHostApiInfo"); 
     63        bindFunc(cast(void**)&Pa_HostApiTypeIdToHostApiIndex, "Pa_HostApiTypeIdToHostApiIndex"); 
     64        bindFunc(cast(void**)&Pa_HostApiDeviceIndexToDeviceIndex, "Pa_HostApiDeviceIndexToDeviceIndex"); 
     65        bindFunc(cast(void**)&Pa_GetLastHostErrorInfo, "Pa_GetLastHostErrorInfo"); 
     66        bindFunc(cast(void**)&Pa_GetDeviceCount, "Pa_GetDeviceCount"); 
     67 
     68        bindFunc(cast(void**)&Pa_GetDefaultInputDevice, "Pa_GetDefaultInputDevice"); 
     69        bindFunc(cast(void**)&Pa_GetDefaultOutputDevice, "Pa_GetDefaultOutputDevice"); 
     70        bindFunc(cast(void**)&Pa_GetDeviceInfo, "Pa_GetDeviceInfo"); 
     71        bindFunc(cast(void**)&Pa_IsFormatSupported, "Pa_IsFormatSupported"); 
     72        bindFunc(cast(void**)&Pa_OpenStream, "Pa_OpenStream"); 
     73        bindFunc(cast(void**)&Pa_OpenDefaultStream, "Pa_OpenDefaultStream"); 
     74        bindFunc(cast(void**)&Pa_CloseStream, "Pa_CloseStream"); 
     75        bindFunc(cast(void**)&Pa_SetStreamFinishedCallback, "Pa_SetStreamFinishedCallback"); 
     76        bindFunc(cast(void**)&Pa_StartStream, "Pa_StartStream"); 
     77        bindFunc(cast(void**)&Pa_StopStream, "Pa_StopStream"); 
     78        bindFunc(cast(void**)&Pa_AbortStream, "Pa_AbortStream"); 
     79        bindFunc(cast(void**)&Pa_IsStreamStopped, "Pa_IsStreamStopped"); 
     80        bindFunc(cast(void**)&Pa_IsStreamActive, "Pa_IsStreamActive"); 
     81        bindFunc(cast(void**)&Pa_GetStreamInfo, "Pa_GetStreamInfo"); 
     82        bindFunc(cast(void**)&Pa_GetStreamTime, "Pa_GetStreamTime"); 
     83        bindFunc(cast(void**)&Pa_GetStreamCpuLoad, "Pa_GetStreamCpuLoad"); 
     84        bindFunc(cast(void**)&Pa_ReadStream, "Pa_ReadStream"); 
     85        bindFunc(cast(void**)&Pa_WriteStream, "Pa_WriteStream"); 
     86        bindFunc(cast(void**)&Pa_GetStreamReadAvailable, "Pa_GetStreamReadAvailable"); 
     87        bindFunc(cast(void**)&Pa_GetStreamWriteAvailable, "Pa_GetStreamWriteAvailable"); 
     88        bindFunc(cast(void**)&Pa_GetSampleSize, "Pa_GetSampleSize"); 
     89        bindFunc(cast(void**)&Pa_Sleep, "Pa_Sleep"); 
     90   
    9191} 
    9292 
     
    9595static this() 
    9696{ 
    97    DerelictPA = new DerelictPALoader(); 
     97    DerelictPA = new DerelictPALoader(); 
    9898} 
    9999 
    100100static ~this() 
    101101{ 
    102     DerelictPA.unload(); 
     102    if(SharedLibLoader.isAutoUnloadEnabled()) 
     103        DerelictPA.unload(); 
    103104} 
  • branches/Derelict2/DerelictSDL/derelict/sdl/image.d

    r569 r591  
    207207static ~this() 
    208208{ 
    209     DerelictSDLImage.unload(); 
    210 
     209    if(SharedLibLoader.isAutoUnloadEnabled()) 
     210        DerelictSDLImage.unload(); 
     211
  • branches/Derelict2/DerelictSDL/derelict/sdl/mixer.d

    r570 r591  
    388388static ~this() 
    389389{ 
    390     DerelictSDLMixer.unload(); 
    391 
     390    if(SharedLibLoader.isAutoUnloadEnabled()) 
     391        DerelictSDLMixer.unload(); 
     392
  • branches/Derelict2/DerelictSDL/derelict/sdl/net.d

    r571 r591  
    278278static ~this() 
    279279{ 
    280     DerelictSDLNet.unload(); 
    281 
     280    if(SharedLibLoader.isAutoUnloadEnabled()) 
     281        DerelictSDLNet.unload(); 
     282
  • branches/Derelict2/DerelictSDL/derelict/sdl/sdl.d

    r470 r591  
    280280static ~this() 
    281281{ 
    282     DerelictSDL.unload(); 
    283 
     282    if(SharedLibLoader.isAutoUnloadEnabled()) 
     283        DerelictSDL.unload(); 
     284
  • branches/Derelict2/DerelictSDL/derelict/sdl/ttf.d

    r572 r591  
    255255static ~this() 
    256256{ 
    257     DerelictSDLttf.unload(); 
    258 
     257    if(SharedLibLoader.isAutoUnloadEnabled()) 
     258        DerelictSDLttf.unload(); 
     259
  • branches/Derelict2/DerelictSFML/derelict/sfml/audio.d

    r526 r591  
    179179static ~this() 
    180180{ 
    181     DerelictSFMLAudio.unload(); 
     181    if(SharedLibLoader.isAutoUnloadEnabled()) 
     182        DerelictSFMLAudio.unload(); 
    182183} 
  • branches/Derelict2/DerelictSFML/derelict/sfml/graphics.d

    r526 r591  
    287287static ~this() 
    288288{ 
    289     DerelictSFMLGraphics.unload(); 
    290 
     289    if(SharedLibLoader.isAutoUnloadEnabled()) 
     290        DerelictSFMLGraphics.unload(); 
     291
  • branches/Derelict2/DerelictSFML/derelict/sfml/network.d

    r526 r591  
    201201static ~this() 
    202202{ 
    203     DerelictSFMLNetwork.unload(); 
    204 
     203    if(SharedLibLoader.isAutoUnloadEnabled()) 
     204        DerelictSFMLNetwork.unload(); 
     205
  • branches/Derelict2/DerelictSFML/derelict/sfml/system.d

    r526 r591  
    9393static ~this() 
    9494{ 
    95     DerelictSFMLSystem.unload(); 
     95    if(SharedLibLoader.isAutoUnloadEnabled()) 
     96        DerelictSFMLSystem.unload(); 
    9697} 
  • branches/Derelict2/DerelictSFML/derelict/sfml/window.d

    r526 r591  
    109109static ~this() 
    110110{ 
    111     DerelictSFMLWindow.unload(); 
     111    if(SharedLibLoader.isAutoUnloadEnabled()) 
     112        DerelictSFMLWindow.unload(); 
    112113} 
  • branches/Derelict2/DerelictUtil/derelict/util/loader.d

    r470 r591  
    5959    } 
    6060 
     61    static void disableAutoUnload() 
     62    { 
     63        _manualUnload = true; 
     64    } 
     65 
     66    static bool isAutoUnloadEnabled() 
     67    { 
     68        return (_manualUnload == false); 
     69    } 
     70 
    6171    void load() 
    6272    { 
     
    113123 
    114124private: 
     125    static bool _manualUnload; 
    115126    string _libNames; 
    116127    SharedLib _lib;