Skip to content

Commit

Permalink
What the f
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Jul 14, 2023
1 parent ccc9e6a commit ce08d4f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bbruntime/bbfilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void bbUnzip(BBStr* src, BBStr* dst, BBStr* password) {
UnzipItem(hz, zi, ze.name);
}
CloseZip(hz);
delete src, dst, password;
delete src; delete dst; delete password;
}

BBStr* bbAbsolutePath(BBStr* path) {
Expand Down
4 changes: 2 additions & 2 deletions bbruntime/bbruntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void bbDisableClose() {

void bbAppTitle(BBStr* ti, BBStr* cp) {
gx_runtime->setTitle(*ti, *cp);
delete ti, cp;
delete ti; delete cp;
}

void bbRuntimeError(BBStr* str) {
Expand Down Expand Up @@ -167,7 +167,7 @@ void bbSetClipboardContents(BBStr* contents) {

void bbMessageBox(BBStr* title, BBStr* text) {
MessageBoxW(gx_runtime->hwnd, UTF8::convertToUtf16(text->c_str()).c_str(), UTF8::convertToUtf16(title->c_str()).c_str(), MB_APPLMODAL | MB_ICONINFORMATION);
delete title, text;
delete title; delete text;
}

void bbDebugLog(BBStr* t) {
Expand Down
4 changes: 2 additions & 2 deletions bbruntime/bbsockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ BBStr* bbParseDomainTXT(BBStr* txt, BBStr* name) {
result = s1.substr(n);
if ((a = result.find(';')) != std::string::npos)
result = result.substr(s2.length() + 1, a - s2.length() - 1);
delete txt, name;
delete txt; delete name;
return new BBStr(result);
}

Expand Down Expand Up @@ -531,7 +531,7 @@ void bbDownloadFile(BBStr* url, BBStr* file) {
InternetCloseHandle(hSession);
hSession = NULL;
}
delete url, file;
delete url; delete file;
}

void sockets_link(void(*rtSym)(const char*, void*)) {
Expand Down
2 changes: 1 addition & 1 deletion bbruntime/bbstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BBStr* bbRight(BBStr* s, int n) {

BBStr* bbReplace(BBStr* s, BBStr* from, BBStr* to) {
std::string str = UTF8::replaceAll(s->c_str(), from->c_str(), to->c_str());
delete s, from, to;
delete s; delete from; delete to;
return new BBStr(str);
}

Expand Down
2 changes: 1 addition & 1 deletion gxruntime/gxutf8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ std::string UTF8::replaceAll(const std::string& string, const std::string& patte

for (unsigned pos = str.find(pattern, 0); pos != std::string::npos; pos = str.find(pattern, pos + nsize))
{
str.replace(pos, psize, newpat);
str = str.replace(pos, psize, newpat);
}
return str;
}
Expand Down

2 comments on commit ce08d4f

@IndependentCommunity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original sources do not have these memory leaks, someone added them.

@ZiYueCommentary
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's me.

Please sign in to comment.