diff options
Diffstat (limited to 'games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch')
-rw-r--r-- | games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch b/games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch deleted file mode 100644 index 8f8e2bf4951a..000000000000 --- a/games-fps/nexuiz/files/nexuiz-2.5-memory-leak.patch +++ /dev/null @@ -1,114 +0,0 @@ -Index: sv_main.c -=================================================================== ---- sv_main.c -+++ sv_main.c -@@ -800,7 +800,7 @@ - sb.data = (unsigned char *) buf; - sb.maxsize = sizeof(buf); - i = 0; -- while(MakeDownloadPacket(sv.csqc_progname, sv.csqc_progdata, sv.csqc_progsize, sv.csqc_progcrc, i++, &sb, sv.protocol)) -+ while(MakeDownloadPacket(sv.csqc_progname, svs.csqc_progdata, sv.csqc_progsize, sv.csqc_progcrc, i++, &sb, sv.protocol)) - SV_WriteDemoMessage(client, &sb, false); - } - -@@ -2234,9 +2234,9 @@ - Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name); - - if(host_client->download_deflate) -- host_client->download_file = FS_FileFromData(sv.csqc_progdata_deflated, sv.csqc_progsize_deflated, true); -+ host_client->download_file = FS_FileFromData(svs.csqc_progdata_deflated, svs.csqc_progsize_deflated, true); - else -- host_client->download_file = FS_FileFromData(sv.csqc_progdata, sv.csqc_progsize, true); -+ host_client->download_file = FS_FileFromData(svs.csqc_progdata, sv.csqc_progsize, true); - - // no, no space is needed between %s and %s :P - Host_ClientCommands("\ncl_downloadbegin %i %s%s\n", (int)FS_FileSize(host_client->download_file), host_client->download_name, extensions); -@@ -2638,37 +2638,37 @@ - { - fs_offset_t progsize; - -- if(sv.csqc_progdata) -+ if(svs.csqc_progdata) - { - Con_DPrintf("Unloading old CSQC data.\n"); -- Mem_Free(sv.csqc_progdata); -- if(sv.csqc_progdata_deflated) -- Mem_Free(sv.csqc_progdata_deflated); -+ Mem_Free(svs.csqc_progdata); -+ if(svs.csqc_progdata_deflated) -+ Mem_Free(svs.csqc_progdata_deflated); - } - -- sv.csqc_progdata = NULL; -- sv.csqc_progdata_deflated = NULL; -+ svs.csqc_progdata = NULL; -+ svs.csqc_progdata_deflated = NULL; - - Con_Print("Loading csprogs.dat\n"); - - sv.csqc_progname[0] = 0; -- sv.csqc_progdata = FS_LoadFile(csqc_progname.string, sv_mempool, false, &progsize); -+ svs.csqc_progdata = FS_LoadFile(csqc_progname.string, sv_mempool, false, &progsize); - - if(progsize > 0) - { - size_t deflated_size; - - sv.csqc_progsize = (int)progsize; -- sv.csqc_progcrc = CRC_Block(sv.csqc_progdata, progsize); -+ sv.csqc_progcrc = CRC_Block(svs.csqc_progdata, progsize); - strlcpy(sv.csqc_progname, csqc_progname.string, sizeof(sv.csqc_progname)); - Con_Printf("server detected csqc progs file \"%s\" with size %i and crc %i\n", sv.csqc_progname, sv.csqc_progsize, sv.csqc_progcrc); - - Con_Print("Compressing csprogs.dat\n"); - //unsigned char *FS_Deflate(const unsigned char *data, size_t size, size_t *deflated_size, int level, mempool_t *mempool); -- sv.csqc_progdata_deflated = FS_Deflate(sv.csqc_progdata, progsize, &deflated_size, -1, sv_mempool); -- sv.csqc_progsize_deflated = (int)deflated_size; -+ svs.csqc_progdata_deflated = FS_Deflate(svs.csqc_progdata, progsize, &deflated_size, -1, sv_mempool); -+ svs.csqc_progsize_deflated = (int)deflated_size; - Con_Printf("Deflated: %g%%\n", 100.0 - 100.0 * (deflated_size / (float)progsize)); -- Con_DPrintf("Uncompressed: %u\nCompressed: %u\n", (unsigned)sv.csqc_progsize, (unsigned)sv.csqc_progsize_deflated); -+ Con_DPrintf("Uncompressed: %u\nCompressed: %u\n", (unsigned)sv.csqc_progsize, (unsigned)svs.csqc_progsize_deflated); - } - } - -Index: jpeg.c -=================================================================== ---- jpeg.c (revision 8850) -+++ jpeg.c (revision 8853) -@@ -1047,6 +1047,8 @@ - // try to compress it to JPEG - *buf = Z_Malloc(maxsize); - *size = JPEG_SaveImage_to_Buffer((char *) *buf, maxsize, image_width, image_height, newimagedata); -+ Mem_Free(newimagedata); -+ - if(!*size) - { - Z_Free(*buf); -Index: server.h -=================================================================== ---- server.h (revision 8850) -+++ server.h (revision 8853) -@@ -48,6 +48,12 @@ - float perf_acc_offset_squared; - float perf_acc_offset_max; - int perf_acc_offset_samples; -+ -+ // csqc stuff -+ unsigned char *csqc_progdata; -+ size_t csqc_progsize_deflated; -+ unsigned char *csqc_progdata_deflated; -+ - } server_static_t; - - //============================================================================= -@@ -87,9 +93,6 @@ - int csqc_progcrc; // -1 = no progs - int csqc_progsize; // -1 = no progs - char csqc_progname[MAX_QPATH]; // copied from csqc_progname at level start -- unsigned char *csqc_progdata; -- size_t csqc_progsize_deflated; -- unsigned char *csqc_progdata_deflated; - - // collision culling data - world_t world; |