Skip to content

Commit

Permalink
Non-interactive sessions no longer destroy saved history.
Browse files Browse the repository at this point in the history
  • Loading branch information
mridgers committed Oct 25, 2012
1 parent bf6784e commit fe37cf4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clink/dll/dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,13 @@ static void failed()
//------------------------------------------------------------------------------
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID unused)
{
static int running = 0;
void* base;

// We're only interested in when the dll is attached.
if (reason != DLL_PROCESS_ATTACH)
{
if (reason == DLL_PROCESS_DETACH)
if (running && reason == DLL_PROCESS_DETACH)
{
save_history();
shutdown_lua();
Expand Down Expand Up @@ -455,5 +456,6 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID unused)
}

success();
running = 1;
return TRUE;
}

0 comments on commit fe37cf4

Please sign in to comment.